Signature
Usage
Velocity Tracking
Return Value
| Field | Type | Description |
|---|---|---|
position | RefObject<THREE.Vector3> | World position from data.xpos |
quaternion | RefObject<THREE.Quaternion> | World rotation from data.xquat (converted to Three.js order) |
linearVelocity | RefObject<THREE.Vector3> | Linear velocity from data.cvel |
angularVelocity | RefObject<THREE.Vector3> | Angular velocity from data.cvel |
Notes
- Returns are refs, not state — read
.currentinuseFrameor event handlers - No re-renders on updates — this is intentional for 60fps performance
- The body is looked up by name once; if the name doesn’t exist, values stay at zero
cvellayout is[angular(3), linear(3)]per body — the hook reorders for you