Skip to main content

Module animation

Module animation 

Source
Expand description

Plain CPU data for keyframe animation — no Asset/ Handle/GPU upload involved, same rationale as skeleton: sampling a clip is pure interpolation math, nothing GPU-specific about it.

Structs§

AnimationClip
A single animation — a name, a duration, and per-joint keyframe tracks. Blending multiple clips (crossfade, additive layering, …) is entirely up to you: sample each clip separately and combine the resulting Transforms yourself — this type only ever samples one clip at a time.
JointTrack
One joint’s animated properties. Any of the three tracks may be empty — glTF allows animating only some of a joint’s translation/rotation/scale; AnimationClip::sample falls back to the joint’s bind pose for whichever are unanimated. Keyframes within each track must be in non-decreasing time order (glTF’s own accessors are spec-guaranteed to already be).
Keyframe
One sample of an animated property at a point in time.

Enums§

Interpolation
glTF 2.0 sampler interpolation. CubicSpline is intentionally absent as a variant — gltf_loader::load_gltf hard-errors on it rather than silently mishandling its 3-value-per-keyframe (in-tangent/value/out-tangent) packing, which would otherwise be misread as plain values.