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<[[f32; 4]; 4]>,
)
pub fn sample_into( &self, t: f32, skeleton: &Skeleton, out: &mut Vec<[[f32; 4]; 4]>, )
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<[[f32; 4]; 4]>,
)
pub fn sample_looped_into( &self, t: f32, looping: bool, skeleton: &Skeleton, out: &mut Vec<[[f32; 4]; 4]>, )
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 moreAuto Trait Implementations§
impl Freeze for AnimationClip
impl RefUnwindSafe for AnimationClip
impl Send for AnimationClip
impl Sync for AnimationClip
impl Unpin for AnimationClip
impl UnsafeUnpin for AnimationClip
impl UnwindSafe for AnimationClip
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more