Table of Contents

Class PhysicsTestMotionParameters2D

Namespace
Godot
Assembly
GodotSharp.dll

By changing various properties of this object, such as the motion, you can configure the parameters for BodyTestMotion(Rid, PhysicsTestMotionParameters2D, PhysicsTestMotionResult2D).

public class PhysicsTestMotionParameters2D : RefCounted, IDisposable
Inheritance
PhysicsTestMotionParameters2D
Implements
Inherited Members

Constructors

PhysicsTestMotionParameters2D()

public PhysicsTestMotionParameters2D()

Properties

CollideSeparationRay

If set to true, shapes of type 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 SeparationRay are only used for separation when overlapping with other bodies. That's the main use for separation ray shapes.

public bool CollideSeparationRay { get; set; }

Property Value

bool

ExcludeBodies

Optional array of body Rid to exclude from collision. Use GetRid() to get the Rid associated with a CollisionObject2D-derived node.

public Array<Rid> ExcludeBodies { get; set; }

Property Value

Array<Rid>

ExcludeObjects

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

public Array<int> ExcludeObjects { get; set; }

Property Value

Array<int>

From

Transform in global space where the motion should start. Usually set to GlobalTransform for the current body's transform.

public Transform2D From { get; set; }

Property Value

Transform2D

Margin

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

public float Margin { get; set; }

Property Value

float

Motion

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

public Vector2 Motion { get; set; }

Property Value

Vector2

RecoveryAsCollision

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.

public bool RecoveryAsCollision { get; set; }

Property Value

bool

Methods

HasGodotClassMethod(in godot_string_name)

Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.

protected override bool HasGodotClassMethod(in godot_string_name method)

Parameters

method godot_string_name

Name of the method to check for.

Returns

bool

HasGodotClassSignal(in godot_string_name)

Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.

protected override bool HasGodotClassSignal(in godot_string_name signal)

Parameters

signal godot_string_name

Name of the signal to check for.

Returns

bool

InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)

Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.

protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)

Parameters

method godot_string_name

Name of the method to invoke.

args NativeVariantPtrArgs

Arguments to use with the invoked method.

ret godot_variant

Value returned by the invoked method.

Returns

bool