Table of Contents

Class GravitasConstraint3DService

Namespace
Gravitas
Assembly
Gravitas.dll

Owns deterministic 3D joints and ragdoll articulation state for one world context.

public sealed class GravitasConstraint3DService
Inheritance
GravitasConstraint3DService
Inherited Members

Properties

Context

Gets the owning world context.

public GravitasWorldContext Context { get; }

Property Value

GravitasWorldContext

PeakJointCount

Gets the highest joint ID allocated in this context.

public int PeakJointCount { get; }

Property Value

int

RegisteredJointCount

Gets the number of registered active joints.

public int RegisteredJointCount { get; }

Property Value

int

RegisteredRagdollCount

Gets the number of registered ragdoll runtimes.

public int RegisteredRagdollCount { get; }

Property Value

int

Methods

ClearJointMotorTarget(int)

Disables a joint motor target and clears its cached solver impulses.

public bool ClearJointMotorTarget(int jointId)

Parameters

jointId int

Returns

bool

GetJoint(int)

Gets a registered joint by context-local ID.

public Joint3D GetJoint(int jointId)

Parameters

jointId int

Returns

Joint3D

RegisterJoint(in JointDefinition3D)

Registers a context-owned deterministic 3D joint.

public Joint3D RegisterJoint(in JointDefinition3D definition)

Parameters

definition JointDefinition3D

Returns

Joint3D

RegisterRagdoll(RagdollDefinition3D)

Registers a ragdoll articulation and its owned joints.

public RagdollRuntime3D RegisterRagdoll(RagdollDefinition3D definition)

Parameters

definition RagdollDefinition3D

Returns

RagdollRuntime3D

RemoveJoint(int)

Removes a context-owned joint and releases its filter state.

public bool RemoveJoint(int jointId)

Parameters

jointId int

Returns

bool

RemoveRagdoll(int)

Removes a registered ragdoll and every joint and collision suppression it owns.

public bool RemoveRagdoll(int ragdollId)

Parameters

ragdollId int

Returns

bool

SetJointMotorTarget(int, FixedQuaternion)

Updates a joint motor target while preserving the joint's authored motor gains and impulse cap.

public bool SetJointMotorTarget(int jointId, FixedQuaternion targetLocalRotation)

Parameters

jointId int
targetLocalRotation FixedQuaternion

Returns

bool

SetRagdollPoseTargets(RagdollRuntime3D, ReadOnlySpan<JointMotor3D>)

Applies caller-owned motor payloads to every joint in a ragdoll runtime.

public void SetRagdollPoseTargets(RagdollRuntime3D ragdoll, ReadOnlySpan<JointMotor3D> motors)

Parameters

ragdoll RagdollRuntime3D
motors ReadOnlySpan<JointMotor3D>

ShouldExcludeLinkedCollision(LSCollider, LSCollider)

Gets whether the supplied 3D colliders should be excluded because a registered articulation links them.

public bool ShouldExcludeLinkedCollision(LSCollider colliderA, LSCollider colliderB)

Parameters

colliderA LSCollider
colliderB LSCollider

Returns

bool

TryGetJoint(int, out Joint3D?)

Tries to get a registered joint by context-local ID.

public bool TryGetJoint(int jointId, out Joint3D? joint)

Parameters

jointId int
joint Joint3D

Returns

bool