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.