Skip to main content
Returns refs tracking a joint’s position and velocity values. Updated every physics frame without re-renders.

Signature

Usage

Return Value

Pass { kind: "scalar" } for hinge/slide joints when you want numeric refs. Pass { kind: "array" } for ball/free joints when you want typed-array refs. Omit kind for generic code that handles both shapes.

Array Size by Joint Type

Notes

  • Returns refs for zero-overhead per-frame reads
  • For hinge/slide joints, values are scalars (not arrays)
  • For ball/free joints, typed arrays are preallocated once and reused via .set() each physics frame — no per-frame allocation
  • For free joints, position is [x, y, z, qw, qx, qy, qz]