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).
type | Constraint |
|---|---|
fixed | Welds two bodies rigidly together. |
revolute | A hinge — rotation about a single axis (doors, wheels). |
prismatic | A slider — translation along a single axis (pistons, lifts). |
spherical | A ball-and-socket — free rotation about a point (ragdoll joints). |
spring | A soft constraint with stiffness, damping, and restLength. |
Fields
Section titled “Fields”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 forrevoluteandprismatic.limits—{ min, max }angle (degrees) or distance forrevolute/prismatic.stiffness,damping,restLength— spring parameters.
See also
Section titled “See also”- Rigid bodies — the bodies a joint connects.
- Scene Schema reference — every joint field.
- Capstone: Vehicle — joints in a working build.