Class GravitasConstraint2DService
- Namespace
- Gravitas
- Assembly
- Gravitas.dll
Owns deterministic pure 2D joints and ragdoll articulation state for one world context.
public sealed class GravitasConstraint2DService
- Inheritance
-
GravitasConstraint2DService
- Inherited Members
Properties
Context
Gets the owning world context.
public GravitasWorldContext Context { get; }
Property Value
PeakJointCount
Gets the highest joint ID allocated in this context.
public int PeakJointCount { get; }
Property Value
RegisteredJointCount
Gets the number of registered active joints.
public int RegisteredJointCount { get; }
Property Value
RegisteredRagdollCount
Gets the number of registered ragdoll runtimes.
public int RegisteredRagdollCount { get; }
Property Value
Methods
ClearJointMotorTarget(int)
Disables a pure 2D joint motor target and clears its cached solver impulses.
public bool ClearJointMotorTarget(int jointId)
Parameters
jointIdint
Returns
GetJoint(int)
Gets a registered pure 2D joint by context-local ID.
public Joint2D GetJoint(int jointId)
Parameters
jointIdint
Returns
RegisterJoint(in JointDefinition2D)
Registers a context-owned deterministic pure 2D joint.
public Joint2D RegisterJoint(in JointDefinition2D definition)
Parameters
definitionJointDefinition2D
Returns
RegisterRagdoll(RagdollDefinition2D)
Registers a pure 2D ragdoll articulation and its owned joints.
public RagdollRuntime2D RegisterRagdoll(RagdollDefinition2D definition)
Parameters
definitionRagdollDefinition2D
Returns
RemoveJoint(int)
Removes a context-owned pure 2D joint and releases its filter state.
public bool RemoveJoint(int jointId)
Parameters
jointIdint
Returns
RemoveRagdoll(int)
Removes a registered pure 2D ragdoll and every joint and collision suppression it owns.
public bool RemoveRagdoll(int ragdollId)
Parameters
ragdollIdint
Returns
SetJointMotorTarget(int, Fixed64)
Updates a pure 2D joint motor target while preserving the motor's gains and impulse cap.
public bool SetJointMotorTarget(int jointId, Fixed64 target)
Parameters
jointIdinttargetFixed64
Returns
SetRagdollPoseTargets(RagdollRuntime2D, ReadOnlySpan<JointMotor2D>)
Applies caller-owned motor payloads to every joint in a pure 2D ragdoll runtime.
public void SetRagdollPoseTargets(RagdollRuntime2D ragdoll, ReadOnlySpan<JointMotor2D> motors)
Parameters
ragdollRagdollRuntime2DmotorsReadOnlySpan<JointMotor2D>
ShouldExcludeLinkedCollision(LSCollider2D, LSCollider2D)
Gets whether the supplied pure 2D colliders should be excluded because a registered articulation links them.
public bool ShouldExcludeLinkedCollision(LSCollider2D colliderA, LSCollider2D colliderB)
Parameters
colliderALSCollider2DcolliderBLSCollider2D
Returns
TryGetJoint(int, out Joint2D?)
Tries to get a registered pure 2D joint by context-local ID.
public bool TryGetJoint(int jointId, out Joint2D? joint)