pub struct AnimationClip {
pub duration: f32,
pub looping: bool,
pub tracks: Vec<JointTrack>,
pub morph_keys: Vec<(f32, Vec<f32>)>,
pub root: Option<RootTrack>,
}Expand description
One animation clip: a fixed-length set of per-joint keyframe tracks.
Fields§
§duration: f32Total clip length in seconds.
looping: boolWhen true, sampling past duration wraps; otherwise it holds the end.
tracks: Vec<JointTrack>One track per animated joint.
morph_keys: Vec<(f32, Vec<f32>)>Morph-target weight keys in time order: (time, one weight per target). Empty for clips that animate no morph targets.
root: Option<RootTrack>The character-displacement curve stripped from the root joint at build time, when the clip opted into root motion. The pose tracks above keep the root anchored; the runtime turns this curve’s frame delta into character movement instead.
Implementations§
Source§impl AnimationClip
impl AnimationClip
Sourcepub fn sample_into(&self, t: f32, skeleton: &Skeleton, out: &mut Vec<Mat4>)
pub fn sample_into(&self, t: f32, skeleton: &Skeleton, out: &mut Vec<Mat4>)
Sample the clip at time t against skeleton, writing one local
matrix per joint into out (cleared first, so its capacity is
reused). Joints with no track keep their bind transform.
Sourcepub fn sample_looped_into(
&self,
t: f32,
looping: bool,
skeleton: &Skeleton,
out: &mut Vec<Mat4>,
)
pub fn sample_looped_into( &self, t: f32, looping: bool, skeleton: &Skeleton, out: &mut Vec<Mat4>, )
sample_into with the loop mode supplied by the caller instead of the
clip’s own flag. Lets a graph state override looping without cloning
the clip.
Sourcepub fn sample_morph_weights_into(
&self,
t: f32,
looping: bool,
out: &mut Vec<f32>,
)
pub fn sample_morph_weights_into( &self, t: f32, looping: bool, out: &mut Vec<f32>, )
Sample the morph-weight track at time t into out (cleared first,
so its capacity is reused), lerping between the surrounding keys with
the same wrap/clamp semantics as pose sampling. out is left empty
when the clip has no morph keys.
Trait Implementations§
Source§impl Clone for AnimationClip
impl Clone for AnimationClip
Source§fn clone(&self) -> AnimationClip
fn clone(&self) -> AnimationClip
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more