Documentation / scene / JointDynamicsSystem
Class: JointDynamicsSystem
Defined in: libs/scene/src/animation/joint_dynamics/joint_dynamics_system.ts:119
Physics system for spring-like joint dynamics on scene node bone chains.
The system builds particles and constraints from one or more bone chains, advances them with Verlet integration, solves constraints and collisions, and writes the resulting positions and rotations back to the scene graph.
Constructors
Constructor
new JointDynamicsSystem(
config,colliders?,grabbers?,flatPlanes?):JointDynamicsSystem
Defined in: libs/scene/src/animation/joint_dynamics/joint_dynamics_system.ts:131
Create a joint dynamics system for one or more bone chains.
Parameters
config
Bone chain topology and controller configuration.
colliders?
object[] = []
Optional colliders to register during initialization.
grabbers?
object[] = []
Optional grabbers to register during initialization.
flatPlanes?
object[] = []
Optional world-space planes that dynamic points cannot cross.
Returns
JointDynamicsSystem
Accessors
controller
Get Signature
get controller():
JointDynamicsSystemController
Defined in: libs/scene/src/animation/joint_dynamics/joint_dynamics_system.ts:237
Get the low-level controller that owns simulation state and advanced runtime controls.
Most callers should prefer the convenience methods on JointDynamicsSystem.
Returns
The underlying joint dynamics controller.
chainConfig
Get Signature
get chainConfig():
JointChainConfig
Defined in: libs/scene/src/animation/joint_dynamics/joint_dynamics_system.ts:244
Get the node chain topology used to construct this system.
Returns
Methods
getColliderSnapshots()
getColliderSnapshots():
JointDynamicsColliderSnapshot[]
Defined in: libs/scene/src/animation/joint_dynamics/joint_dynamics_system.ts:254
Returns detached collider snapshots for serialization.
Returns
JointDynamicsColliderSnapshot[]
getFlatPlaneSnapshots()
getFlatPlaneSnapshots():
JointDynamicsFlatPlaneSnapshot[]
Defined in: libs/scene/src/animation/joint_dynamics/joint_dynamics_system.ts:261
Returns detached flat-plane snapshots for serialization.
Returns
JointDynamicsFlatPlaneSnapshot[]
getGrabberSnapshots()
getGrabberSnapshots():
JointDynamicsGrabberSnapshot[]
Defined in: libs/scene/src/animation/joint_dynamics/joint_dynamics_system.ts:268
Returns detached grabber snapshots for serialization.
Returns
JointDynamicsGrabberSnapshot[]
resetChains()
resetChains():
void
Defined in: libs/scene/src/animation/joint_dynamics/joint_dynamics_system.ts:275
Reset chain nodes to bind pose
Returns
void
addCollider()
addCollider(
r,transform?):JointDynamicsColliderHandle
Defined in: libs/scene/src/animation/joint_dynamics/joint_dynamics_system.ts:298
Add a fully configured collider at runtime.
The collider transform is read from the supplied scene node every simula ; ion step. If no transform is supplied, the collider is created at the identity transform.
Parameters
r
Read-only collider parameters.
transform?
Optional scene node that drives the collider transform.
Returns
A stable handle that remains valid until this collider is removed.
addSphereCollider()
addSphereCollider(
radius,transform?,friction?,inversed?):JointDynamicsColliderHandle
Defined in: libs/scene/src/animation/joint_dynamics/joint_dynamics_system.ts:314
Add a spherical collider at runtime.
The collider transform is read from the supplied scene node every simulation step. If no transform is supplied, the collider is created at the identity transform.
Parameters
radius
number
Sphere radius in world units before transform scaling.
transform?
Optional scene node that drives the collider transform.
friction?
number
Contact friction coefficient applied by this collider. Defaults to 0.
inversed?
boolean
If true, points are constrained inside the sphere instead of pushed out.
Returns
A stable handle that remains valid until this collider is removed.
addCapsuleCollider()
addCapsuleCollider(
radius,height,transform?,radiusTailScale?,friction?,inversed?):JointDynamicsColliderHandle
Defined in: libs/scene/src/animation/joint_dynamics/joint_dynamics_system.ts:348
Add a capsule collider at runtime.
The capsule is aligned to the collider transform's local Y axis. Its head radius is radius, its tail radius is radius * radiusTailScale, and height defines the distance between the capsule ends before transform scaling.
Parameters
radius
number
Capsule head radius in world units before transform scaling.
height
number
Capsule length in world units before transform scaling.
transform?
Optional scene node that drives the collider transform.
radiusTailScale?
number
Tail radius multiplier relative to the head radius. Defaults to 1.
friction?
number
Contact friction coefficient applied by this collider. Defaults to 0.
inversed?
boolean
If true, points are constrained inside the capsule instead of pushed out.
Returns
A stable handle that remains valid until this collider is removed.
setColliderEnabled()
setColliderEnabled(
handle,enabled):boolean
Defined in: libs/scene/src/animation/joint_dynamics/joint_dynamics_system.ts:378
Enable or disable a collider by stable handle.
Disabled colliders remain registered but are ignored by simulation until re-enabled.
Parameters
handle
Collider handle returned by addCollider, addSphereCollider, or addCapsuleCollider.
enabled
boolean
Whether the collider should participate in simulation.
Returns
boolean
true if the handle is valid and the enabled state was updated.
removeCollider()
removeCollider(
handle):boolean
Defined in: libs/scene/src/animation/joint_dynamics/joint_dynamics_system.ts:388
Remove a collider by stable handle.
Parameters
handle
Collider handle returned by addCollider, addSphereCollider, or addCapsuleCollider.
Returns
boolean
true if the collider existed and was removed.
removeColliderAt()
removeColliderAt(
index):boolean
Defined in: libs/scene/src/animation/joint_dynamics/joint_dynamics_system.ts:400
Remove a collider by current array index.
Prefer removeCollider(handle) for runtime-owned colliders.
Parameters
index
number
Current collider array index.
Returns
boolean
true if the collider existed and was removed.
addFlatPlane()
addFlatPlane(
up,position):JointDynamicsFlatPlaneHandle
Defined in: libs/scene/src/animation/joint_dynamics/joint_dynamics_system.ts:414
Add a flat plane collider at runtime.
Flat planes are infinite world-space planes. The normal points toward the allowed side, and dynamic points are pushed back when they move behind the plane.
Parameters
up
Vector3
Plane normal in world space.
position
Vector3
A point on the plane in world space.
Returns
A stable handle that remains valid until this flat plane is removed.
setFlatPlaneEnabled()
setFlatPlaneEnabled(
handle,enabled):boolean
Defined in: libs/scene/src/animation/joint_dynamics/joint_dynamics_system.ts:427
Enable or disable a flat plane by stable handle.
Disabled flat planes remain registered but are ignored by simulation until re-enabled.
Parameters
handle
Flat plane handle returned by addFlatPlane.
enabled
boolean
Whether the flat plane should participate in simulation.
Returns
boolean
true if the handle is valid and the enabled state was updated.
removeFlatPlane()
removeFlatPlane(
handle):boolean
Defined in: libs/scene/src/animation/joint_dynamics/joint_dynamics_system.ts:437
Remove a flat plane by stable handle.
Parameters
handle
Flat plane handle returned by addFlatPlane.
Returns
boolean
true if the flat plane existed and was removed.
removeFlatPlaneAt()
removeFlatPlaneAt(
index):boolean
Defined in: libs/scene/src/animation/joint_dynamics/joint_dynamics_system.ts:448
Remove a flat plane by current array index. Prefer removeFlatPlane(handle) for runtime-owned flat planes.
Parameters
index
number
Current flat plane array index.
Returns
boolean
true if the flat plane existed and was removed.
addGrabber()
addGrabber(
r,transform?):JointDynamicsGrabberHandle
Defined in: libs/scene/src/animation/joint_dynamics/joint_dynamics_system.ts:462
Add a grabber at runtime.
The grabber transform is read from the supplied scene node every simulation step. If no transform is supplied, the grabber is created at the identity transform.
Parameters
r
Read-only grabber parameters.
transform?
Optional scene node that drives the grabber transform.
Returns
A stable handle that remains valid until this grabber is removed.
setGrabberEnabled()
setGrabberEnabled(
handle,enabled):boolean
Defined in: libs/scene/src/animation/joint_dynamics/joint_dynamics_system.ts:475
Enable or disable a grabber by stable handle.
Disabling a grabber also releases any points currently held by it.
Parameters
handle
Grabber handle returned by addGrabber.
enabled
boolean
Whether the grabber should participate in simulation.
Returns
boolean
true if the handle is valid and the enabled state was updated.
removeGrabber()
removeGrabber(
handle):boolean
Defined in: libs/scene/src/animation/joint_dynamics/joint_dynamics_system.ts:485
Remove a grabber by stable handle.
Parameters
handle
Grabber handle returned by addGrabber.
Returns
boolean
true if the grabber existed and was removed.
removeGrabberAt()
removeGrabberAt(
index):boolean
Defined in: libs/scene/src/animation/joint_dynamics/joint_dynamics_system.ts:497
Remove a grabber by current array index.
Prefer removeGrabber(handle) for runtime-owned grabbers.
Parameters
index
number
Current grabber array index.
Returns
boolean
true if the grabber existed and was removed.
update()
update(
deltaTime):void
Defined in: libs/scene/src/animation/joint_dynamics/joint_dynamics_system.ts:521
Advance the physics simulation and write the resulting transforms back to the chain nodes.
Parameters
deltaTime
number
Frame time step in seconds. Values larger than 0.033 are clamped for stability.
Returns
void