Skip to content

Interface: BodyMotionHandle

Stateful handle returned by createBodyMotion. Owns the spin angle accumulator and writes the resulting orientation onto a target THREE.Group.

Properties

spinAngle

ts
spinAngle: number;

Accumulated self-rotation angle (rad). Mutable for replay / scrub.


tick

ts
tick: (dt) => void;

Advances spinAngle by the elapsed dt. The caller decides whether and when to call this — passing 0 (or skipping the call entirely) freezes the body's rotation, which is how "pause" is expressed without the lib needing to know about pause.

Parameters

ParameterType
dtnumber

Returns

void


applyTo

ts
applyTo: (group) => void;

Writes the current orientation onto a THREE.Group. Only the quaternion is touched — the group's world position is left untouched so the caller stays in charge of placing the body in the scene.

Parameters

ParameterType
groupGroup

Returns

void

Distribué sous la licence indiquée dans le dépôt.