[][src]Struct skeletal_animation::animation::AnimationClip

pub struct AnimationClip<T: Transform> {
    pub samples: Vec<AnimationSample<T>>,
    pub samples_per_second: f32,
}

A sequence of skeletal pose samples at some sample rate

Fields

samples: Vec<AnimationSample<T>>

The sequence of skeletal poses

samples_per_second: f32

Sample rate for the clip. Assumes a constant sample rate.

Methods

impl<T: Transform> AnimationClip<T>[src]

pub fn from_def(
    clip_def: &AnimationClipDef,
    parent_folder: PathBuf
) -> AnimationClip<T>
[src]

parent_folder is the folder to search for the AnimationClip's source file

pub fn set_duration(&mut self, duration: f32)[src]

Overrides the sampling rate of the clip to give the given duration (in seconds).

pub fn get_duration(&self) -> f32[src]

Return the duration of the clip in seconds

pub fn get_pose_at_time(&self, elapsed_time: f32, blended_poses: &mut [T])[src]

Obtains the interpolated skeletal pose at the given sampling time.

Arguments

  • time - The time to sample with, relative to the start of the animation
  • blended_poses - The output array slice of joint transforms that will be populated for each joint in the skeleton.

pub fn as_difference_clip(
    source_clip: &AnimationClip<T>,
    reference_clip: &AnimationClip<T>
) -> AnimationClip<T>
[src]

Create a difference clip from a source and reference clip for additive blending.

pub fn from_collada(
    skeleton: &Skeleton,
    animations: &Vec<Animation>,
    transform: &Matrix4<f32>
) -> AnimationClip<T>
[src]

Creates an AnimationClip from a collection of collada::Animation.

Arguments

  • skeleton - The Skeleton that the AnimationClip will be created for.
  • animations - The collection of collada::Animations that will be converted into an AnimationClip, using the given Skeleton.
  • transform - An offset transform to apply to the root pose of each animation sample, useful for applying rotation, translation, or scaling when loading an animation.

Trait Implementations

impl<T: Debug + Transform> Debug for AnimationClip<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for AnimationClip<T> where
    T: RefUnwindSafe

impl<T> Send for AnimationClip<T> where
    T: Send

impl<T> Sync for AnimationClip<T> where
    T: Sync

impl<T> Unpin for AnimationClip<T> where
    T: Unpin

impl<T> UnwindSafe for AnimationClip<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SetParameter for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.