Skip to content

Joints

A joint constrains two rigid bodies relative to each other. Joints are declared by the joint schema (packages/engine/src/scene/schema/joint.ts) on an entity and link it to a target entity by id. They are created in the loader’s second pass, after all bodies exist (see the three-pass loader).

fixed, revolute, prismatic, spherical, and spring joints
The five joint types.
typeConstraint
fixedWelds two bodies rigidly together.
revoluteA hinge β€” rotation about a single axis (doors, wheels).
prismaticA slider β€” translation along a single axis (pistons, lifts).
sphericalA ball-and-socket β€” free rotation about a point (ragdoll joints).
springA soft constraint with stiffness, damping, and restLength.
  • target β€” entity id of the body this joint connects to.
  • anchor / targetAnchor β€” local anchor points on this body and the target.
  • axis β€” rotation/slide axis for revolute and prismatic.
  • limits β€” { min, max } angle (degrees) or distance for revolute / prismatic.
  • stiffness, damping, restLength β€” spring parameters.