Module animation

Source
Expand description

Tracks, bounded playback/events, pose blending and reusable animation controllers.

Structs§

AnimationBank
Shared immutable authoring data. Every Animator allocates only its own pose scratch buffers once; hundreds of actors can reuse this bank’s tracks.
AnimationClip
Immutable, cheaply cloned clip. Untracked properties retain the bank’s bind pose. Parent indices/hierarchy belong to the scene Skeleton, not the clip.
AnimationDiagnostic
An authoring error with the zero-based position of the offending key/frame.
AnimationEvent
AnimationGraph
AnimationState
AnimationTransition
Animator
Reusable local-pose player. Crossfades keep the outgoing clip moving. An interrupted crossfade snapshots the current base blend before layers, so reapplying aim/recoil cannot bake the same layer into the source twice. If the fade has not advanced yet, retargeting keeps the original outgoing clip moving. Events come only from the incoming clip, avoiding duplicate footstep/weapon events during transitions. Layers are visual and do not emit extra events. No frame, play/seek/transition or layer operation allocates after construction.
EventBuffer
Fixed caller-owned event queue. Overflow drops the latest events, reports the exact number dropped, and never prevents the clock/pose from advancing.
EventCatchUpReport
Per-update catch-up diagnostics from EventBuffer::report. Counts describe event crossings, including repeated IDs and keys with identical timestamps. Dropped crossings are consumed: they are never replayed on a later update.
EventHit
EventTrack
FootContact
FootPlant
Allocation-free presentation contact state. The caller supplies support queries and elapsed presentation time; this never changes body motion.
FootPlantThresholds
Contact acquisition and retention rules for FootPlant::with_thresholds.
FootPose
GraphPlayer
Bounded state graph with deterministic authored transition priority. Examines transitions once before each nonzero, unpaused update; completion conditions become eligible on the next update after reaching the end. At most one edge wins per call, so unconditional graph cycles cannot spin inside one frame.
JointMask
JointTrack
Keyframe
LimbPose
SpriteClip
SpriteFrame
SpritePlayer
Uses the same clock, pause/speed/seek semantics and bounded events as skeletal animation. Frame IDs are authored drawing/atlas IDs; no texture API is required.
Timeline
Forward playback at 0..=8x, with f64 phase accumulation and saturating loop counts. Pausing, zero speed and zero dt preserve pending start events. Seeking is silent. Resuming never re-emits an already crossed event.
Track
TwoBone

Enums§

AnimationCondition
AnimationError
AnimationTransitionEligibility
Read-only result of checking one authored edge against a graph player.
Interpolation
LayerMode
LoopMode

Constants§

MAX_ANIMATION_CLIPS
MAX_ANIMATION_DT
Large host stalls must be split explicitly; each update does bounded event work.
MAX_ANIMATION_EVENTS
MAX_ANIMATION_JOINTS
MAX_ANIMATION_PARAMETERS
MAX_ANIMATION_STATES
MAX_ANIMATION_TRANSITIONS
MAX_CLIP_SECONDS
MAX_TRACK_KEYS

Traits§

Sample

Functions§

additive_pose_into
Add a pose relative to an authored reference. Numeric overflow is rejected before writing any output. Zero effective weight preserves the exact base transform; excluded joints still require valid inputs and matching lengths. Allocation-free. See Animator::apply_layer for a reusable in-place layer stack using the bank’s bind pose as its reference.
blend_pose_into
Blend local TRS values using shortest-arc normalized quaternion interpolation. Allocation-free; malformed lengths, poses or weights leave output unchanged. A joint with zero effective weight retains its exact base transform, including its quaternion magnitude. All inputs are validated even for excluded joints.

Type Aliases§

QuatTrack
Quaternion order is [x, y, z, w]. Samples are normalized, including exact keys.
ScalarTrack
Vec3Track