Skip to main content

Module anim

Module anim 

Source
Expand description

Runtime pose evaluation on top of the clip data (animation + skeleton): sampling a clip into a joint pose, blending poses, override layers with joint masks, and CCD inverse kinematics.

Determinism contract (same doctrine as the other CPU cores): fixed-step time, pure glam arithmetic, no randomness. Keyframe interpolation keeps using KeyValue::lerp (slerp for rotations); pose blends use shortest-arc normalized lerp, and the IK builds its align rotations with Quat::from_rotation_arc (square roots and cross products only — no transcendental at runtime). Evaluation stays a pure function of (skeleton, clip library, animator state) — the precondition for a scrubbable editor timeline and for offline rendering.

Structs§

Animator
Single-track playback with crossfades plus a stack of override layers. step is the fixed-timestep door (the physics doctrine): drive it with a constant dt for replayable results. Switching to the same clip is a deliberate no-op — restarts belong to the caller (sequencer).
Layer
An override layer above the base animation. weight = 0 is inert, weight = 1 lets the layer’s clip drive its masked joints wholesale.
Pose
A full local pose of a skeleton: one Transform per joint, index-aligned with Skeleton::joints.

Enums§

LayerMask
Which joints a layer is allowed to drive.

Functions§

blend
Blend two poses: w = 0 keeps a, w = 1 takes b.