Skip to main content

AnimationClip

Struct AnimationClip 

Source
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: f32

Total clip length in seconds.

§looping: bool

When 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

Source

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.

Source

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.

Source

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

Source§

fn clone(&self) -> AnimationClip

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AnimationClip

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.