PhysicsTestMotionParameters2D
Provides parameters for PhysicsServer2D.body_test_motion.
Provides parameters for PhysicsServer2D.BodyTestMotion.
By changing various properties of this object, such as the motion, you can configure the parameters for PhysicsServer2D.BodyTestMotion.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
PhysicsTestMotionParameters2DConstructor
public PhysicsTestMotionParameters2D();Properties7
CollideSeparationRayProperty
public bool CollideSeparationRay { get; set; }If set to true, shapes of type PhysicsServer2D.ShapeType.SeparationRay are used to detect collisions and can stop the motion. Can be useful when snapping to the ground.
If set to false, shapes of type PhysicsServer2D.ShapeType.SeparationRay are only used for separation when overlapping with other bodies. That's the main use for separation ray shapes.
ExcludeBodiesProperty
public Reckfell.Collections.Array<Rid> ExcludeBodies { get; set; }Optional array of body Rid to exclude from collision. Use CollisionObject2D.GetRid to get the Rid associated with a CollisionObject2D-derived node.
ExcludeObjectsProperty
public Reckfell.Collections.Array<int> ExcludeObjects { get; set; }Optional array of object unique instance ID to exclude from collision. See ReckfellObject.GetInstanceId.
FromProperty
public Transform2D From { get; set; }Transform in global space where the motion should start. Usually set to Entity2D.GlobalTransform for the current body's transform.
MarginProperty
public float Margin { get; set; }Increases the size of the shapes involved in the collision detection.
MotionProperty
public Vector2 Motion { get; set; }Motion vector to define the length and direction of the motion to test.
RecoveryAsCollisionProperty
public bool RecoveryAsCollision { get; set; }If set to true, any depenetration from the recovery phase is reported as a collision; this is used e.g. by CharacterBody2D for improving floor detection during floor snapping.
If set to false, only collisions resulting from the motion are reported, which is generally the desired behavior.
Methods14
GetExcludeBodiesReckfell.Collections.Array<Rid>
public Reckfell.Collections.Array<Rid> GetExcludeBodies();Reckfell.Collections.Array<Rid>GetExcludeObjectsReckfell.Collections.Array<int>
public Reckfell.Collections.Array<int> GetExcludeObjects();Reckfell.Collections.Array<int>GetFromTransform2D
public Transform2D GetFrom();Transform2DGetMarginfloat
public float GetMargin();floatGetMotionVector2
public Vector2 GetMotion();Vector2IsCollideSeparationRayEnabledbool
public bool IsCollideSeparationRayEnabled();boolIsRecoveryAsCollisionEnabledbool
public bool IsRecoveryAsCollisionEnabled();boolSetCollideSeparationRayEnabledvoid
public void SetCollideSeparationRayEnabled(bool enabled);| Name | Type | Default |
|---|---|---|
enabled | bool | — |
SetExcludeBodiesvoid
public void SetExcludeBodies(Reckfell.Collections.Array<Rid> excludeList);| Name | Type | Default |
|---|---|---|
excludeList | Reckfell.Collections.Array<Rid> | — |
SetExcludeObjectsvoid
public void SetExcludeObjects(Reckfell.Collections.Array<int> excludeList);| Name | Type | Default |
|---|---|---|
excludeList | Reckfell.Collections.Array<int> | — |
SetFromvoid
public void SetFrom(Transform2D from);| Name | Type | Default |
|---|---|---|
from | Transform2D | — |
SetMarginvoid
public void SetMargin(float margin);| Name | Type | Default |
|---|---|---|
margin | float | — |
SetMotionvoid
public void SetMotion(Vector2 motion);| Name | Type | Default |
|---|---|---|
motion | Vector2 | — |
SetRecoveryAsCollisionEnabledvoid
public void SetRecoveryAsCollisionEnabled(bool enabled);| Name | Type | Default |
|---|---|---|
enabled | bool | — |