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

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.

Implementations§

source§

impl<T: Transform> AnimationClip<T>

source

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

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

source

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

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

source

pub fn get_duration(&self) -> f32

Return the duration of the clip in seconds

source

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

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.
source

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

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

source

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

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§

source§

impl<T: Debug + Transform> Debug for AnimationClip<T>

source§

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

Formats the value using the given formatter. Read more

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§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.