Click or drag to resize

PhysicsDirectSpaceStateCastMotion Method

Checks how far a Shape can move without colliding. All the parameters for the query, including the shape, are supplied through a PhysicsShapeQueryParameters object.

Returns an array with the safe and unsafe proportions (between 0 and 1) of the motion. The safe proportion is the maximum fraction of the motion that can be made without a collision. The unsafe proportion is the minimum fraction of the distance that must be moved for a collision. If no collision is detected a result of [1.0, 1.0] will be returned.

Note: Any Shapes that the shape is already colliding with e.g. inside of, will be ignored. Use CollideShape(PhysicsShapeQueryParameters, Int32) to determine the Shapes that the shape is already colliding with.

Namespace:  Godot
Assembly:  GodotSharp (in GodotSharp.dll) Version: 1.0.0
Syntax
C#
public Array CastMotion(
	PhysicsShapeQueryParameters shape,
	Vector3 motion
)

Parameters

shape
Type: GodotPhysicsShapeQueryParameters

[Missing <param name="shape"/> documentation for "M:Godot.PhysicsDirectSpaceState.CastMotion(Godot.PhysicsShapeQueryParameters,Godot.Vector3)"]

motion
Type: GodotVector3

[Missing <param name="motion"/> documentation for "M:Godot.PhysicsDirectSpaceState.CastMotion(Godot.PhysicsShapeQueryParameters,Godot.Vector3)"]

Return Value

Type: Array

[Missing <returns> documentation for "M:Godot.PhysicsDirectSpaceState.CastMotion(Godot.PhysicsShapeQueryParameters,Godot.Vector3)"]

See Also