Table of Contents

Class PhysicsDirectBodyState2DExtension

Namespace
Godot
Assembly
GodotSharp.dll

This class extends PhysicsDirectBodyState2D by providing additional virtual methods that can be overridden. When these methods are overridden, they will be called instead of the internal methods of the physics server.

Intended for use with GDExtension to create custom implementations of PhysicsDirectBodyState2D.

public class PhysicsDirectBodyState2DExtension : PhysicsDirectBodyState2D, IDisposable
Inheritance
PhysicsDirectBodyState2DExtension
Implements
Inherited Members

Constructors

PhysicsDirectBodyState2DExtension()

public PhysicsDirectBodyState2DExtension()

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

_AddConstantCentralForce(Vector2)

Overridable version of AddConstantCentralForce(Vector2?).

public virtual void _AddConstantCentralForce(Vector2 force)

Parameters

force Vector2

_AddConstantForce(Vector2, Vector2)

Overridable version of AddConstantForce(Vector2, Vector2?).

public virtual void _AddConstantForce(Vector2 force, Vector2 position)

Parameters

force Vector2
position Vector2

_AddConstantTorque(float)

Overridable version of AddConstantTorque(float).

public virtual void _AddConstantTorque(float torque)

Parameters

torque float

_ApplyCentralForce(Vector2)

Overridable version of ApplyCentralForce(Vector2?).

public virtual void _ApplyCentralForce(Vector2 force)

Parameters

force Vector2

_ApplyCentralImpulse(Vector2)

Overridable version of ApplyCentralImpulse(Vector2).

public virtual void _ApplyCentralImpulse(Vector2 impulse)

Parameters

impulse Vector2

_ApplyForce(Vector2, Vector2)

Overridable version of ApplyForce(Vector2, Vector2?).

public virtual void _ApplyForce(Vector2 force, Vector2 position)

Parameters

force Vector2
position Vector2

_ApplyImpulse(Vector2, Vector2)

Overridable version of ApplyImpulse(Vector2, Vector2?).

public virtual void _ApplyImpulse(Vector2 impulse, Vector2 position)

Parameters

impulse Vector2
position Vector2

_ApplyTorque(float)

Overridable version of ApplyTorque(float).

public virtual void _ApplyTorque(float torque)

Parameters

torque float

_ApplyTorqueImpulse(float)

Overridable version of ApplyTorqueImpulse(float).

public virtual void _ApplyTorqueImpulse(float impulse)

Parameters

impulse float

_GetAngularVelocity()

Implement to override the behavior of AngularVelocity and its respective getter.

public virtual float _GetAngularVelocity()

Returns

float

_GetCenterOfMass()

Implement to override the behavior of CenterOfMass and its respective getter.

public virtual Vector2 _GetCenterOfMass()

Returns

Vector2

_GetCenterOfMassLocal()

Implement to override the behavior of CenterOfMassLocal and its respective getter.

public virtual Vector2 _GetCenterOfMassLocal()

Returns

Vector2

_GetConstantForce()

Overridable version of GetConstantForce().

public virtual Vector2 _GetConstantForce()

Returns

Vector2

_GetConstantTorque()

Overridable version of GetConstantTorque().

public virtual float _GetConstantTorque()

Returns

float

_GetContactCollider(int)

Overridable version of GetContactCollider(int).

public virtual Rid _GetContactCollider(int contactIdx)

Parameters

contactIdx int

Returns

Rid

_GetContactColliderId(int)

Overridable version of GetContactColliderId(int).

public virtual ulong _GetContactColliderId(int contactIdx)

Parameters

contactIdx int

Returns

ulong

_GetContactColliderObject(int)

Overridable version of GetContactColliderObject(int).

public virtual GodotObject _GetContactColliderObject(int contactIdx)

Parameters

contactIdx int

Returns

GodotObject

_GetContactColliderPosition(int)

Overridable version of GetContactColliderPosition(int).

public virtual Vector2 _GetContactColliderPosition(int contactIdx)

Parameters

contactIdx int

Returns

Vector2

_GetContactColliderShape(int)

Overridable version of GetContactColliderShape(int).

public virtual int _GetContactColliderShape(int contactIdx)

Parameters

contactIdx int

Returns

int

_GetContactColliderVelocityAtPosition(int)

public virtual Vector2 _GetContactColliderVelocityAtPosition(int contactIdx)

Parameters

contactIdx int

Returns

Vector2

_GetContactCount()

Overridable version of GetContactCount().

public virtual int _GetContactCount()

Returns

int

_GetContactImpulse(int)

Overridable version of GetContactImpulse(int).

public virtual Vector2 _GetContactImpulse(int contactIdx)

Parameters

contactIdx int

Returns

Vector2

_GetContactLocalNormal(int)

Overridable version of GetContactLocalNormal(int).

public virtual Vector2 _GetContactLocalNormal(int contactIdx)

Parameters

contactIdx int

Returns

Vector2

_GetContactLocalPosition(int)

Overridable version of GetContactLocalPosition(int).

public virtual Vector2 _GetContactLocalPosition(int contactIdx)

Parameters

contactIdx int

Returns

Vector2

_GetContactLocalShape(int)

Overridable version of GetContactLocalShape(int).

public virtual int _GetContactLocalShape(int contactIdx)

Parameters

contactIdx int

Returns

int

_GetContactLocalVelocityAtPosition(int)

public virtual Vector2 _GetContactLocalVelocityAtPosition(int contactIdx)

Parameters

contactIdx int

Returns

Vector2

_GetInverseInertia()

Implement to override the behavior of InverseInertia and its respective getter.

public virtual float _GetInverseInertia()

Returns

float

_GetInverseMass()

Implement to override the behavior of InverseMass and its respective getter.

public virtual float _GetInverseMass()

Returns

float

_GetLinearVelocity()

Implement to override the behavior of LinearVelocity and its respective getter.

public virtual Vector2 _GetLinearVelocity()

Returns

Vector2

_GetSpaceState()

Overridable version of GetSpaceState().

public virtual PhysicsDirectSpaceState2D _GetSpaceState()

Returns

PhysicsDirectSpaceState2D

_GetStep()

Implement to override the behavior of Step and its respective getter.

public virtual float _GetStep()

Returns

float

_GetTotalAngularDamp()

Implement to override the behavior of TotalAngularDamp and its respective getter.

public virtual float _GetTotalAngularDamp()

Returns

float

_GetTotalGravity()

Implement to override the behavior of TotalGravity and its respective getter.

public virtual Vector2 _GetTotalGravity()

Returns

Vector2

_GetTotalLinearDamp()

Implement to override the behavior of TotalLinearDamp and its respective getter.

public virtual float _GetTotalLinearDamp()

Returns

float

_GetTransform()

Implement to override the behavior of Transform and its respective getter.

public virtual Transform2D _GetTransform()

Returns

Transform2D

_GetVelocityAtLocalPosition(Vector2)

Overridable version of GetVelocityAtLocalPosition(Vector2).

public virtual Vector2 _GetVelocityAtLocalPosition(Vector2 localPosition)

Parameters

localPosition Vector2

Returns

Vector2

_IntegrateForces()

Overridable version of IntegrateForces().

public virtual void _IntegrateForces()

_IsSleeping()

Implement to override the behavior of Sleeping and its respective getter.

public virtual bool _IsSleeping()

Returns

bool

_SetAngularVelocity(float)

Implement to override the behavior of AngularVelocity and its respective setter.

public virtual void _SetAngularVelocity(float velocity)

Parameters

velocity float

_SetConstantForce(Vector2)

Overridable version of SetConstantForce(Vector2).

public virtual void _SetConstantForce(Vector2 force)

Parameters

force Vector2

_SetConstantTorque(float)

Overridable version of SetConstantTorque(float).

public virtual void _SetConstantTorque(float torque)

Parameters

torque float

_SetLinearVelocity(Vector2)

Implement to override the behavior of LinearVelocity and its respective setter.

public virtual void _SetLinearVelocity(Vector2 velocity)

Parameters

velocity Vector2

_SetSleepState(bool)

Implement to override the behavior of Sleeping and its respective setter.

public virtual void _SetSleepState(bool enabled)

Parameters

enabled bool

_SetTransform(Transform2D)

Implement to override the behavior of Transform and its respective setter.

public virtual void _SetTransform(Transform2D transform)

Parameters

transform Transform2D