Table of Contents

Class PhysicsServer2DExtension

Namespace
Godot
Assembly
GodotSharp.dll

This class extends PhysicsServer2D 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 PhysicsServer2D.

public class PhysicsServer2DExtension : PhysicsServer2DInstance, IDisposable
Inheritance
PhysicsServer2DExtension
Implements
Inherited Members

Constructors

PhysicsServer2DExtension()

public PhysicsServer2DExtension()

Methods

BodyTestMotionIsExcludingBody(Rid)

Returns true if the body with the given Rid is being excluded from _body_test_motion. See also GetInstanceId().

public bool BodyTestMotionIsExcludingBody(Rid body)

Parameters

body Rid

Returns

bool

BodyTestMotionIsExcludingObject(ulong)

Returns true if the object with the given instance ID is being excluded from _body_test_motion. See also GetInstanceId().

public bool BodyTestMotionIsExcludingObject(ulong @object)

Parameters

object ulong

Returns

bool

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

_AreaAddShape(Rid, Rid, Transform2D, bool)

public virtual void _AreaAddShape(Rid area, Rid shape, Transform2D transform, bool disabled)

Parameters

area Rid
shape Rid
transform Transform2D
disabled bool

_AreaAttachCanvasInstanceId(Rid, ulong)

public virtual void _AreaAttachCanvasInstanceId(Rid area, ulong id)

Parameters

area Rid
id ulong

_AreaAttachObjectInstanceId(Rid, ulong)

public virtual void _AreaAttachObjectInstanceId(Rid area, ulong id)

Parameters

area Rid
id ulong

_AreaClearShapes(Rid)

Overridable version of AreaClearShapes(Rid).

public virtual void _AreaClearShapes(Rid area)

Parameters

area Rid

_AreaCreate()

Overridable version of AreaCreate().

public virtual Rid _AreaCreate()

Returns

Rid

_AreaGetCanvasInstanceId(Rid)

Overridable version of AreaGetCanvasInstanceId(Rid).

public virtual ulong _AreaGetCanvasInstanceId(Rid area)

Parameters

area Rid

Returns

ulong

_AreaGetCollisionLayer(Rid)

Overridable version of AreaGetCollisionLayer(Rid).

public virtual uint _AreaGetCollisionLayer(Rid area)

Parameters

area Rid

Returns

uint

_AreaGetCollisionMask(Rid)

Overridable version of AreaGetCollisionMask(Rid).

public virtual uint _AreaGetCollisionMask(Rid area)

Parameters

area Rid

Returns

uint

_AreaGetObjectInstanceId(Rid)

Overridable version of AreaGetObjectInstanceId(Rid).

public virtual ulong _AreaGetObjectInstanceId(Rid area)

Parameters

area Rid

Returns

ulong

_AreaGetParam(Rid, AreaParameter)

Overridable version of AreaGetParam(Rid, AreaParameter).

public virtual Variant _AreaGetParam(Rid area, PhysicsServer2D.AreaParameter param)

Parameters

area Rid
param PhysicsServer2D.AreaParameter

Returns

Variant

_AreaGetShape(Rid, int)

Overridable version of AreaGetShape(Rid, int).

public virtual Rid _AreaGetShape(Rid area, int shapeIdx)

Parameters

area Rid
shapeIdx int

Returns

Rid

_AreaGetShapeCount(Rid)

Overridable version of AreaGetShapeCount(Rid).

public virtual int _AreaGetShapeCount(Rid area)

Parameters

area Rid

Returns

int

_AreaGetShapeTransform(Rid, int)

Overridable version of AreaGetShapeTransform(Rid, int).

public virtual Transform2D _AreaGetShapeTransform(Rid area, int shapeIdx)

Parameters

area Rid
shapeIdx int

Returns

Transform2D

_AreaGetSpace(Rid)

Overridable version of AreaGetSpace(Rid).

public virtual Rid _AreaGetSpace(Rid area)

Parameters

area Rid

Returns

Rid

_AreaGetTransform(Rid)

Overridable version of AreaGetTransform(Rid).

public virtual Transform2D _AreaGetTransform(Rid area)

Parameters

area Rid

Returns

Transform2D

_AreaRemoveShape(Rid, int)

Overridable version of AreaRemoveShape(Rid, int).

public virtual void _AreaRemoveShape(Rid area, int shapeIdx)

Parameters

area Rid
shapeIdx int

_AreaSetAreaMonitorCallback(Rid, Callable)

public virtual void _AreaSetAreaMonitorCallback(Rid area, Callable callback)

Parameters

area Rid
callback Callable

_AreaSetCollisionLayer(Rid, uint)

Overridable version of AreaSetCollisionLayer(Rid, uint).

public virtual void _AreaSetCollisionLayer(Rid area, uint layer)

Parameters

area Rid
layer uint

_AreaSetCollisionMask(Rid, uint)

Overridable version of AreaSetCollisionMask(Rid, uint).

public virtual void _AreaSetCollisionMask(Rid area, uint mask)

Parameters

area Rid
mask uint

_AreaSetMonitorCallback(Rid, Callable)

Overridable version of AreaSetMonitorCallback(Rid, Callable).

public virtual void _AreaSetMonitorCallback(Rid area, Callable callback)

Parameters

area Rid
callback Callable

_AreaSetMonitorable(Rid, bool)

Overridable version of AreaSetMonitorable(Rid, bool).

public virtual void _AreaSetMonitorable(Rid area, bool monitorable)

Parameters

area Rid
monitorable bool

_AreaSetParam(Rid, AreaParameter, Variant)

public virtual void _AreaSetParam(Rid area, PhysicsServer2D.AreaParameter param, Variant value)

Parameters

area Rid
param PhysicsServer2D.AreaParameter
value Variant

_AreaSetPickable(Rid, bool)

If set to true, allows the area with the given Rid to detect mouse inputs when the mouse cursor is hovering on it.

Overridable version of PhysicsServer2D's internal area_set_pickable method. Corresponds to InputPickable.

public virtual void _AreaSetPickable(Rid area, bool pickable)

Parameters

area Rid
pickable bool

_AreaSetShape(Rid, int, Rid)

Overridable version of AreaSetShape(Rid, int, Rid).

public virtual void _AreaSetShape(Rid area, int shapeIdx, Rid shape)

Parameters

area Rid
shapeIdx int
shape Rid

_AreaSetShapeDisabled(Rid, int, bool)

Overridable version of AreaSetShapeDisabled(Rid, int, bool).

public virtual void _AreaSetShapeDisabled(Rid area, int shapeIdx, bool disabled)

Parameters

area Rid
shapeIdx int
disabled bool

_AreaSetShapeTransform(Rid, int, Transform2D)

public virtual void _AreaSetShapeTransform(Rid area, int shapeIdx, Transform2D transform)

Parameters

area Rid
shapeIdx int
transform Transform2D

_AreaSetSpace(Rid, Rid)

Overridable version of AreaSetSpace(Rid, Rid).

public virtual void _AreaSetSpace(Rid area, Rid space)

Parameters

area Rid
space Rid

_AreaSetTransform(Rid, Transform2D)

Overridable version of AreaSetTransform(Rid, Transform2D).

public virtual void _AreaSetTransform(Rid area, Transform2D transform)

Parameters

area Rid
transform Transform2D

_BodyAddCollisionException(Rid, Rid)

Overridable version of BodyAddCollisionException(Rid, Rid).

public virtual void _BodyAddCollisionException(Rid body, Rid exceptedBody)

Parameters

body Rid
exceptedBody Rid

_BodyAddConstantCentralForce(Rid, Vector2)

public virtual void _BodyAddConstantCentralForce(Rid body, Vector2 force)

Parameters

body Rid
force Vector2

_BodyAddConstantForce(Rid, Vector2, Vector2)

public virtual void _BodyAddConstantForce(Rid body, Vector2 force, Vector2 position)

Parameters

body Rid
force Vector2
position Vector2

_BodyAddConstantTorque(Rid, float)

Overridable version of BodyAddConstantTorque(Rid, float).

public virtual void _BodyAddConstantTorque(Rid body, float torque)

Parameters

body Rid
torque float

_BodyAddShape(Rid, Rid, Transform2D, bool)

public virtual void _BodyAddShape(Rid body, Rid shape, Transform2D transform, bool disabled)

Parameters

body Rid
shape Rid
transform Transform2D
disabled bool

_BodyApplyCentralForce(Rid, Vector2)

Overridable version of BodyApplyCentralForce(Rid, Vector2).

public virtual void _BodyApplyCentralForce(Rid body, Vector2 force)

Parameters

body Rid
force Vector2

_BodyApplyCentralImpulse(Rid, Vector2)

Overridable version of BodyApplyCentralImpulse(Rid, Vector2).

public virtual void _BodyApplyCentralImpulse(Rid body, Vector2 impulse)

Parameters

body Rid
impulse Vector2

_BodyApplyForce(Rid, Vector2, Vector2)

public virtual void _BodyApplyForce(Rid body, Vector2 force, Vector2 position)

Parameters

body Rid
force Vector2
position Vector2

_BodyApplyImpulse(Rid, Vector2, Vector2)

public virtual void _BodyApplyImpulse(Rid body, Vector2 impulse, Vector2 position)

Parameters

body Rid
impulse Vector2
position Vector2

_BodyApplyTorque(Rid, float)

Overridable version of BodyApplyTorque(Rid, float).

public virtual void _BodyApplyTorque(Rid body, float torque)

Parameters

body Rid
torque float

_BodyApplyTorqueImpulse(Rid, float)

Overridable version of BodyApplyTorqueImpulse(Rid, float).

public virtual void _BodyApplyTorqueImpulse(Rid body, float impulse)

Parameters

body Rid
impulse float

_BodyAttachCanvasInstanceId(Rid, ulong)

public virtual void _BodyAttachCanvasInstanceId(Rid body, ulong id)

Parameters

body Rid
id ulong

_BodyAttachObjectInstanceId(Rid, ulong)

public virtual void _BodyAttachObjectInstanceId(Rid body, ulong id)

Parameters

body Rid
id ulong

_BodyClearShapes(Rid)

Overridable version of BodyClearShapes(Rid).

public virtual void _BodyClearShapes(Rid body)

Parameters

body Rid

_BodyCreate()

Overridable version of BodyCreate().

public virtual Rid _BodyCreate()

Returns

Rid

_BodyGetCanvasInstanceId(Rid)

Overridable version of BodyGetCanvasInstanceId(Rid).

public virtual ulong _BodyGetCanvasInstanceId(Rid body)

Parameters

body Rid

Returns

ulong

_BodyGetCollisionExceptions(Rid)

Returns the Rids of all bodies added as collision exceptions for the given body. See also _BodyAddCollisionException(Rid, Rid) and _BodyRemoveCollisionException(Rid, Rid).

Overridable version of PhysicsServer2D's internal body_get_collision_exceptions method. Corresponds to GetCollisionExceptions().

public virtual Array<Rid> _BodyGetCollisionExceptions(Rid body)

Parameters

body Rid

Returns

Array<Rid>

_BodyGetCollisionLayer(Rid)

Overridable version of BodyGetCollisionLayer(Rid).

public virtual uint _BodyGetCollisionLayer(Rid body)

Parameters

body Rid

Returns

uint

_BodyGetCollisionMask(Rid)

Overridable version of BodyGetCollisionMask(Rid).

public virtual uint _BodyGetCollisionMask(Rid body)

Parameters

body Rid

Returns

uint

_BodyGetCollisionPriority(Rid)

Overridable version of BodyGetCollisionPriority(Rid).

public virtual float _BodyGetCollisionPriority(Rid body)

Parameters

body Rid

Returns

float

_BodyGetConstantForce(Rid)

Overridable version of BodyGetConstantForce(Rid).

public virtual Vector2 _BodyGetConstantForce(Rid body)

Parameters

body Rid

Returns

Vector2

_BodyGetConstantTorque(Rid)

Overridable version of BodyGetConstantTorque(Rid).

public virtual float _BodyGetConstantTorque(Rid body)

Parameters

body Rid

Returns

float

_BodyGetContactsReportedDepthThreshold(Rid)

Overridable version of PhysicsServer2D's internal body_get_contacts_reported_depth_threshold method.

Note: This method is currently unused by Godot's default physics implementation.

public virtual float _BodyGetContactsReportedDepthThreshold(Rid body)

Parameters

body Rid

Returns

float

_BodyGetContinuousCollisionDetectionMode(Rid)

public virtual PhysicsServer2D.CcdMode _BodyGetContinuousCollisionDetectionMode(Rid body)

Parameters

body Rid

Returns

PhysicsServer2D.CcdMode

_BodyGetDirectState(Rid)

Overridable version of BodyGetDirectState(Rid).

public virtual PhysicsDirectBodyState2D _BodyGetDirectState(Rid body)

Parameters

body Rid

Returns

PhysicsDirectBodyState2D

_BodyGetMaxContactsReported(Rid)

Overridable version of BodyGetMaxContactsReported(Rid).

public virtual int _BodyGetMaxContactsReported(Rid body)

Parameters

body Rid

Returns

int

_BodyGetMode(Rid)

Overridable version of BodyGetMode(Rid).

public virtual PhysicsServer2D.BodyMode _BodyGetMode(Rid body)

Parameters

body Rid

Returns

PhysicsServer2D.BodyMode

_BodyGetObjectInstanceId(Rid)

Overridable version of BodyGetObjectInstanceId(Rid).

public virtual ulong _BodyGetObjectInstanceId(Rid body)

Parameters

body Rid

Returns

ulong

_BodyGetParam(Rid, BodyParameter)

Overridable version of BodyGetParam(Rid, BodyParameter).

public virtual Variant _BodyGetParam(Rid body, PhysicsServer2D.BodyParameter param)

Parameters

body Rid
param PhysicsServer2D.BodyParameter

Returns

Variant

_BodyGetShape(Rid, int)

Overridable version of BodyGetShape(Rid, int).

public virtual Rid _BodyGetShape(Rid body, int shapeIdx)

Parameters

body Rid
shapeIdx int

Returns

Rid

_BodyGetShapeCount(Rid)

Overridable version of BodyGetShapeCount(Rid).

public virtual int _BodyGetShapeCount(Rid body)

Parameters

body Rid

Returns

int

_BodyGetShapeTransform(Rid, int)

Overridable version of BodyGetShapeTransform(Rid, int).

public virtual Transform2D _BodyGetShapeTransform(Rid body, int shapeIdx)

Parameters

body Rid
shapeIdx int

Returns

Transform2D

_BodyGetSpace(Rid)

Overridable version of BodyGetSpace(Rid).

public virtual Rid _BodyGetSpace(Rid body)

Parameters

body Rid

Returns

Rid

_BodyGetState(Rid, BodyState)

Overridable version of BodyGetState(Rid, BodyState).

public virtual Variant _BodyGetState(Rid body, PhysicsServer2D.BodyState state)

Parameters

body Rid
state PhysicsServer2D.BodyState

Returns

Variant

_BodyIsOmittingForceIntegration(Rid)

Overridable version of BodyIsOmittingForceIntegration(Rid).

public virtual bool _BodyIsOmittingForceIntegration(Rid body)

Parameters

body Rid

Returns

bool

_BodyRemoveCollisionException(Rid, Rid)

public virtual void _BodyRemoveCollisionException(Rid body, Rid exceptedBody)

Parameters

body Rid
exceptedBody Rid

_BodyRemoveShape(Rid, int)

Overridable version of BodyRemoveShape(Rid, int).

public virtual void _BodyRemoveShape(Rid body, int shapeIdx)

Parameters

body Rid
shapeIdx int

_BodyResetMassProperties(Rid)

Overridable version of BodyResetMassProperties(Rid).

public virtual void _BodyResetMassProperties(Rid body)

Parameters

body Rid

_BodySetAxisVelocity(Rid, Vector2)

Overridable version of BodySetAxisVelocity(Rid, Vector2).

public virtual void _BodySetAxisVelocity(Rid body, Vector2 axisVelocity)

Parameters

body Rid
axisVelocity Vector2

_BodySetCollisionLayer(Rid, uint)

Overridable version of BodySetCollisionLayer(Rid, uint).

public virtual void _BodySetCollisionLayer(Rid body, uint layer)

Parameters

body Rid
layer uint

_BodySetCollisionMask(Rid, uint)

Overridable version of BodySetCollisionMask(Rid, uint).

public virtual void _BodySetCollisionMask(Rid body, uint mask)

Parameters

body Rid
mask uint

_BodySetCollisionPriority(Rid, float)

Overridable version of BodySetCollisionPriority(Rid, float).

public virtual void _BodySetCollisionPriority(Rid body, float priority)

Parameters

body Rid
priority float

_BodySetConstantForce(Rid, Vector2)

Overridable version of BodySetConstantForce(Rid, Vector2).

public virtual void _BodySetConstantForce(Rid body, Vector2 force)

Parameters

body Rid
force Vector2

_BodySetConstantTorque(Rid, float)

Overridable version of BodySetConstantTorque(Rid, float).

public virtual void _BodySetConstantTorque(Rid body, float torque)

Parameters

body Rid
torque float

_BodySetContactsReportedDepthThreshold(Rid, float)

Overridable version of PhysicsServer2D's internal body_set_contacts_reported_depth_threshold method.

Note: This method is currently unused by Godot's default physics implementation.

public virtual void _BodySetContactsReportedDepthThreshold(Rid body, float threshold)

Parameters

body Rid
threshold float

_BodySetContinuousCollisionDetectionMode(Rid, CcdMode)

public virtual void _BodySetContinuousCollisionDetectionMode(Rid body, PhysicsServer2D.CcdMode mode)

Parameters

body Rid
mode PhysicsServer2D.CcdMode

_BodySetForceIntegrationCallback(Rid, Callable, Variant)

public virtual void _BodySetForceIntegrationCallback(Rid body, Callable callable, Variant userdata)

Parameters

body Rid
callable Callable
userdata Variant

_BodySetMaxContactsReported(Rid, int)

Overridable version of BodySetMaxContactsReported(Rid, int).

public virtual void _BodySetMaxContactsReported(Rid body, int amount)

Parameters

body Rid
amount int

_BodySetMode(Rid, BodyMode)

Overridable version of BodySetMode(Rid, BodyMode).

public virtual void _BodySetMode(Rid body, PhysicsServer2D.BodyMode mode)

Parameters

body Rid
mode PhysicsServer2D.BodyMode

_BodySetOmitForceIntegration(Rid, bool)

public virtual void _BodySetOmitForceIntegration(Rid body, bool enable)

Parameters

body Rid
enable bool

_BodySetParam(Rid, BodyParameter, Variant)

public virtual void _BodySetParam(Rid body, PhysicsServer2D.BodyParameter param, Variant value)

Parameters

body Rid
param PhysicsServer2D.BodyParameter
value Variant

_BodySetPickable(Rid, bool)

If set to true, allows the body with the given Rid to detect mouse inputs when the mouse cursor is hovering on it.

Overridable version of PhysicsServer2D's internal body_set_pickable method. Corresponds to InputPickable.

public virtual void _BodySetPickable(Rid body, bool pickable)

Parameters

body Rid
pickable bool

_BodySetShape(Rid, int, Rid)

Overridable version of BodySetShape(Rid, int, Rid).

public virtual void _BodySetShape(Rid body, int shapeIdx, Rid shape)

Parameters

body Rid
shapeIdx int
shape Rid

_BodySetShapeAsOneWayCollision(Rid, int, bool, float)

public virtual void _BodySetShapeAsOneWayCollision(Rid body, int shapeIdx, bool enable, float margin)

Parameters

body Rid
shapeIdx int
enable bool
margin float

_BodySetShapeDisabled(Rid, int, bool)

Overridable version of BodySetShapeDisabled(Rid, int, bool).

public virtual void _BodySetShapeDisabled(Rid body, int shapeIdx, bool disabled)

Parameters

body Rid
shapeIdx int
disabled bool

_BodySetShapeTransform(Rid, int, Transform2D)

public virtual void _BodySetShapeTransform(Rid body, int shapeIdx, Transform2D transform)

Parameters

body Rid
shapeIdx int
transform Transform2D

_BodySetSpace(Rid, Rid)

Overridable version of BodySetSpace(Rid, Rid).

public virtual void _BodySetSpace(Rid body, Rid space)

Parameters

body Rid
space Rid

_BodySetState(Rid, BodyState, Variant)

Overridable version of BodySetState(Rid, BodyState, Variant).

public virtual void _BodySetState(Rid body, PhysicsServer2D.BodyState state, Variant value)

Parameters

body Rid
state PhysicsServer2D.BodyState
value Variant

_BodySetStateSyncCallback(Rid, Callable)

Assigns the body to call the given callable during the synchronization phase of the loop, before _Step(float) is called. See also _Sync().

Overridable version of PhysicsServer2D's internal body_set_state_sync_callback method.

public virtual void _BodySetStateSyncCallback(Rid body, Callable callable)

Parameters

body Rid
callable Callable

_CapsuleShapeCreate()

Overridable version of CapsuleShapeCreate().

public virtual Rid _CapsuleShapeCreate()

Returns

Rid

_CircleShapeCreate()

Overridable version of CircleShapeCreate().

public virtual Rid _CircleShapeCreate()

Returns

Rid

_ConcavePolygonShapeCreate()

Overridable version of ConcavePolygonShapeCreate().

public virtual Rid _ConcavePolygonShapeCreate()

Returns

Rid

_ConvexPolygonShapeCreate()

Overridable version of ConvexPolygonShapeCreate().

public virtual Rid _ConvexPolygonShapeCreate()

Returns

Rid

_DampedSpringJointGetParam(Rid, DampedSpringParam)

public virtual float _DampedSpringJointGetParam(Rid joint, PhysicsServer2D.DampedSpringParam param)

Parameters

joint Rid
param PhysicsServer2D.DampedSpringParam

Returns

float

_DampedSpringJointSetParam(Rid, DampedSpringParam, float)

public virtual void _DampedSpringJointSetParam(Rid joint, PhysicsServer2D.DampedSpringParam param, float value)

Parameters

joint Rid
param PhysicsServer2D.DampedSpringParam
value float

_EndSync()

Called to indicate that the physics server has stopped synchronizing. It is in the loop's iteration/physics phase, and can access physics objects even if running on a separate thread. See also _Sync().

Overridable version of PhysicsServer2D's internal end_sync method.

public virtual void _EndSync()

_Finish()

Called when the main loop finalizes to shut down the physics server. See also _Finalize() and PhysicsServer2DExtension().

Overridable version of PhysicsServer2D's internal finish method.

public virtual void _Finish()

_FlushQueries()

Called every physics step before _Step(float) to process all remaining queries.

Overridable version of PhysicsServer2D's internal flush_queries method.

public virtual void _FlushQueries()

_FreeRid(Rid)

Overridable version of FreeRid(Rid).

public virtual void _FreeRid(Rid rid)

Parameters

rid Rid

_GetProcessInfo(ProcessInfo)

Overridable version of GetProcessInfo(ProcessInfo).

public virtual int _GetProcessInfo(PhysicsServer2D.ProcessInfo processInfo)

Parameters

processInfo PhysicsServer2D.ProcessInfo

Returns

int

_Init()

Called when the main loop is initialized and creates a new instance of this physics server. See also _Initialize() and _Finish().

Overridable version of PhysicsServer2D's internal init method.

public virtual void _Init()

_IsFlushingQueries()

Overridable method that should return true when the physics server is processing queries. See also _FlushQueries().

Overridable version of PhysicsServer2D's internal is_flushing_queries method.

public virtual bool _IsFlushingQueries()

Returns

bool

_JointClear(Rid)

Overridable version of JointClear(Rid).

public virtual void _JointClear(Rid joint)

Parameters

joint Rid

_JointCreate()

Overridable version of JointCreate().

public virtual Rid _JointCreate()

Returns

Rid

_JointDisableCollisionsBetweenBodies(Rid, bool)

public virtual void _JointDisableCollisionsBetweenBodies(Rid joint, bool disable)

Parameters

joint Rid
disable bool

_JointGetParam(Rid, JointParam)

Overridable version of JointGetParam(Rid, JointParam).

public virtual float _JointGetParam(Rid joint, PhysicsServer2D.JointParam param)

Parameters

joint Rid
param PhysicsServer2D.JointParam

Returns

float

_JointGetType(Rid)

Overridable version of JointGetType(Rid).

public virtual PhysicsServer2D.JointType _JointGetType(Rid joint)

Parameters

joint Rid

Returns

PhysicsServer2D.JointType

_JointIsDisabledCollisionsBetweenBodies(Rid)

public virtual bool _JointIsDisabledCollisionsBetweenBodies(Rid joint)

Parameters

joint Rid

Returns

bool

_JointMakeDampedSpring(Rid, Vector2, Vector2, Rid, Rid)

public virtual void _JointMakeDampedSpring(Rid joint, Vector2 anchorA, Vector2 anchorB, Rid bodyA, Rid bodyB)

Parameters

joint Rid
anchorA Vector2
anchorB Vector2
bodyA Rid
bodyB Rid

_JointMakeGroove(Rid, Vector2, Vector2, Vector2, Rid, Rid)

public virtual void _JointMakeGroove(Rid joint, Vector2 aGroove1, Vector2 aGroove2, Vector2 bAnchor, Rid bodyA, Rid bodyB)

Parameters

joint Rid
aGroove1 Vector2
aGroove2 Vector2
bAnchor Vector2
bodyA Rid
bodyB Rid

_JointMakePin(Rid, Vector2, Rid, Rid)

Overridable version of JointMakePin(Rid, Vector2, Rid, Rid).

public virtual void _JointMakePin(Rid joint, Vector2 anchor, Rid bodyA, Rid bodyB)

Parameters

joint Rid
anchor Vector2
bodyA Rid
bodyB Rid

_JointSetParam(Rid, JointParam, float)

Overridable version of JointSetParam(Rid, JointParam, float).

public virtual void _JointSetParam(Rid joint, PhysicsServer2D.JointParam param, float value)

Parameters

joint Rid
param PhysicsServer2D.JointParam
value float

_PinJointGetFlag(Rid, PinJointFlag)

Overridable version of PinJointGetFlag(Rid, PinJointFlag).

public virtual bool _PinJointGetFlag(Rid joint, PhysicsServer2D.PinJointFlag flag)

Parameters

joint Rid
flag PhysicsServer2D.PinJointFlag

Returns

bool

_PinJointGetParam(Rid, PinJointParam)

Overridable version of PinJointGetParam(Rid, PinJointParam).

public virtual float _PinJointGetParam(Rid joint, PhysicsServer2D.PinJointParam param)

Parameters

joint Rid
param PhysicsServer2D.PinJointParam

Returns

float

_PinJointSetFlag(Rid, PinJointFlag, bool)

public virtual void _PinJointSetFlag(Rid joint, PhysicsServer2D.PinJointFlag flag, bool enabled)

Parameters

joint Rid
flag PhysicsServer2D.PinJointFlag
enabled bool

_PinJointSetParam(Rid, PinJointParam, float)

public virtual void _PinJointSetParam(Rid joint, PhysicsServer2D.PinJointParam param, float value)

Parameters

joint Rid
param PhysicsServer2D.PinJointParam
value float

_RectangleShapeCreate()

Overridable version of RectangleShapeCreate().

public virtual Rid _RectangleShapeCreate()

Returns

Rid

_SegmentShapeCreate()

Overridable version of SegmentShapeCreate().

public virtual Rid _SegmentShapeCreate()

Returns

Rid

_SeparationRayShapeCreate()

Overridable version of SeparationRayShapeCreate().

public virtual Rid _SeparationRayShapeCreate()

Returns

Rid

_SetActive(bool)

Overridable version of SetActive(bool).

public virtual void _SetActive(bool active)

Parameters

active bool

_ShapeGetCustomSolverBias(Rid)

Should return the custom solver bias of the given shape, which defines how much bodies are forced to separate on contact when this shape is involved.

Overridable version of PhysicsServer2D's internal shape_get_custom_solver_bias method. Corresponds to CustomSolverBias.

public virtual float _ShapeGetCustomSolverBias(Rid shape)

Parameters

shape Rid

Returns

float

_ShapeGetData(Rid)

Overridable version of ShapeGetData(Rid).

public virtual Variant _ShapeGetData(Rid shape)

Parameters

shape Rid

Returns

Variant

_ShapeGetType(Rid)

Overridable version of ShapeGetType(Rid).

public virtual PhysicsServer2D.ShapeType _ShapeGetType(Rid shape)

Parameters

shape Rid

Returns

PhysicsServer2D.ShapeType

_ShapeSetCustomSolverBias(Rid, float)

Should set the custom solver bias for the given shape. It defines how much bodies are forced to separate on contact.

Overridable version of PhysicsServer2D's internal shape_get_custom_solver_bias method. Corresponds to CustomSolverBias.

public virtual void _ShapeSetCustomSolverBias(Rid shape, float bias)

Parameters

shape Rid
bias float

_ShapeSetData(Rid, Variant)

Overridable version of ShapeSetData(Rid, Variant).

public virtual void _ShapeSetData(Rid shape, Variant data)

Parameters

shape Rid
data Variant

_SpaceCreate()

Overridable version of SpaceCreate().

public virtual Rid _SpaceCreate()

Returns

Rid

_SpaceGetContactCount(Rid)

Should return how many contacts have occurred during the last physics step in the given space. See also _SpaceGetContacts(Rid) and _SpaceSetDebugContacts(Rid, int).

Overridable version of PhysicsServer2D's internal space_get_contact_count method.

public virtual int _SpaceGetContactCount(Rid space)

Parameters

space Rid

Returns

int

_SpaceGetContacts(Rid)

Should return the positions of all contacts that have occurred during the last physics step in the given space. See also _SpaceGetContactCount(Rid) and _SpaceSetDebugContacts(Rid, int).

Overridable version of PhysicsServer2D's internal space_get_contacts method.

public virtual Vector2[] _SpaceGetContacts(Rid space)

Parameters

space Rid

Returns

Vector2[]

_SpaceGetDirectState(Rid)

Overridable version of SpaceGetDirectState(Rid).

public virtual PhysicsDirectSpaceState2D _SpaceGetDirectState(Rid space)

Parameters

space Rid

Returns

PhysicsDirectSpaceState2D

_SpaceGetParam(Rid, SpaceParameter)

Overridable version of SpaceGetParam(Rid, SpaceParameter).

public virtual float _SpaceGetParam(Rid space, PhysicsServer2D.SpaceParameter param)

Parameters

space Rid
param PhysicsServer2D.SpaceParameter

Returns

float

_SpaceIsActive(Rid)

Overridable version of SpaceIsActive(Rid).

public virtual bool _SpaceIsActive(Rid space)

Parameters

space Rid

Returns

bool

_SpaceSetActive(Rid, bool)

Overridable version of SpaceSetActive(Rid, bool).

public virtual void _SpaceSetActive(Rid space, bool active)

Parameters

space Rid
active bool

_SpaceSetDebugContacts(Rid, int)

Used internally to allow the given space to store contact points, up to maxContacts. This is automatically set for the main World2D's space when DebugCollisionsHint is true, or by checking "Visible Collision Shapes" in the editor. Only works in debug builds.

Overridable version of PhysicsServer2D's internal space_set_debug_contacts method.

public virtual void _SpaceSetDebugContacts(Rid space, int maxContacts)

Parameters

space Rid
maxContacts int

_SpaceSetParam(Rid, SpaceParameter, float)

public virtual void _SpaceSetParam(Rid space, PhysicsServer2D.SpaceParameter param, float value)

Parameters

space Rid
param PhysicsServer2D.SpaceParameter
value float

_Step(float)

Called every physics step to process the physics simulation. step is the time elapsed since the last physics step, in seconds. It is usually the same as GetPhysicsProcessDeltaTime().

Overridable version of PhysicsServer2D's internal step method.

public virtual void _Step(float step)

Parameters

step float

_Sync()

Called to indicate that the physics server is synchronizing and cannot access physics states if running on a separate thread. See also _EndSync().

Overridable version of PhysicsServer2D's internal sync method.

public virtual void _Sync()

_WorldBoundaryShapeCreate()

Overridable version of WorldBoundaryShapeCreate().

public virtual Rid _WorldBoundaryShapeCreate()

Returns

Rid