reckfellENGINE

PhysicsTestMotionParameters2D

Provides parameters for PhysicsServer2D.body_test_motion.

On this page
class PhysicsTestMotionParameters2DReckfellSharpInherits RefCounted

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
# PhysicsTestMotionParameters2D
C#
public PhysicsTestMotionParameters2D();

Properties7

CollideSeparationRayProperty
# CollideSeparationRay
C#
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
# ExcludeBodies
C#
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
# ExcludeObjects
C#
public Reckfell.Collections.Array<int> ExcludeObjects { get; set; }

Optional array of object unique instance ID to exclude from collision. See ReckfellObject.GetInstanceId.

FromProperty
# From
C#
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
# Margin
C#
public float Margin { get; set; }

Increases the size of the shapes involved in the collision detection.

MotionProperty
# Motion
C#
public Vector2 Motion { get; set; }

Motion vector to define the length and direction of the motion to test.

RecoveryAsCollisionProperty
# RecoveryAsCollision
C#
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>
# GetExcludeBodies
C#
public Reckfell.Collections.Array<Rid> GetExcludeBodies();
Returns Reckfell.Collections.Array<Rid>
GetExcludeObjectsReckfell.Collections.Array<int>
# GetExcludeObjects
C#
public Reckfell.Collections.Array<int> GetExcludeObjects();
Returns Reckfell.Collections.Array<int>
GetFromTransform2D
# GetFrom
C#
public Transform2D GetFrom();
Returns Transform2D
GetMarginfloat
# GetMargin
C#
public float GetMargin();
Returns float
GetMotionVector2
# GetMotion
C#
public Vector2 GetMotion();
Returns Vector2
IsCollideSeparationRayEnabledbool
# IsCollideSeparationRayEnabled
C#
public bool IsCollideSeparationRayEnabled();
Returns bool
IsRecoveryAsCollisionEnabledbool
# IsRecoveryAsCollisionEnabled
C#
public bool IsRecoveryAsCollisionEnabled();
Returns bool
SetCollideSeparationRayEnabledvoid
# SetCollideSeparationRayEnabled
C#
public void SetCollideSeparationRayEnabled(bool enabled);
Parameters
NameTypeDefault
enabledbool—
SetExcludeBodiesvoid
# SetExcludeBodies
C#
public void SetExcludeBodies(Reckfell.Collections.Array<Rid> excludeList);
Parameters
NameTypeDefault
excludeListReckfell.Collections.Array<Rid>—
SetExcludeObjectsvoid
# SetExcludeObjects
C#
public void SetExcludeObjects(Reckfell.Collections.Array<int> excludeList);
Parameters
NameTypeDefault
excludeListReckfell.Collections.Array<int>—
SetFromvoid
# SetFrom
C#
public void SetFrom(Transform2D from);
Parameters
NameTypeDefault
fromTransform2D—
SetMarginvoid
# SetMargin
C#
public void SetMargin(float margin);
Parameters
NameTypeDefault
marginfloat—
SetMotionvoid
# SetMotion
C#
public void SetMotion(Vector2 motion);
Parameters
NameTypeDefault
motionVector2—
SetRecoveryAsCollisionEnabledvoid
# SetRecoveryAsCollisionEnabled
C#
public void SetRecoveryAsCollisionEnabled(bool enabled);
Parameters
NameTypeDefault
enabledbool—
Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.