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. |
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.