Skip to content

@modoki/engine / index / Joint3D

Variable: Joint3D

const Joint3D: Trait<{ anchorAX: number; anchorAY: number; anchorAZ: number; anchorBX: number; anchorBY: number; anchorBZ: number; axisX: number; axisY: number; axisZ: number; damping: number; entityA: string; entityB: string; length: number; limitMax: number; limitMin: number; limitsEnabled: boolean; motorDamping: number; motorEnabled: boolean; motorStiffness: number; motorTargetPos: number; motorTargetVel: number; stiffness: number; type: JointType3D; }>

A constraint between two RigidBody3D entities. Attach Joint3D to a THIRD entity (or either body) — it is not a body itself, just a link record. entityA/entityB are GUIDs (like BoneAttachment.target); the joint activates once both resolve to bodies. Anchors are local offsets (world units) on each body.

Unit notes (converted to Rapier's frame by physics3DSystem; NO axis flip — 3D is right-handed Y-up like Rapier):

  • anchors/axis: world units, scaled by Physics3D.unitsPerMeter.
  • length: world units (spring rest / rope max).
  • revolute motor/limit values are ANGLES (radians about axis); prismatic ones are DISTANCES (world units) along axis. Motors/limits apply to revolute + prismatic only.

Built with Modoki.