pub struct KeyframeAnimator {
pub keyframes: Vec<DeformKeyframe>,
pub interpolation: KeyframeInterp,
pub looping: bool,
pub time: f32,
}Expand description
Animates a scalar value over time using keyframes.
Fields§
§keyframes: Vec<DeformKeyframe>§interpolation: KeyframeInterp§looping: boolWhether the animation loops.
time: f32Current time.
Implementations§
Source§impl KeyframeAnimator
impl KeyframeAnimator
Sourcepub fn with_interpolation(self, interp: KeyframeInterp) -> Self
pub fn with_interpolation(self, interp: KeyframeInterp) -> Self
Set interpolation mode.
Sourcepub fn with_looping(self, looping: bool) -> Self
pub fn with_looping(self, looping: bool) -> Self
Enable looping.
Sourcepub fn evaluate_at(&self, time: f32) -> f32
pub fn evaluate_at(&self, time: f32) -> f32
Evaluate the animated value at a specific time.
Sourcepub fn is_finished(&self) -> bool
pub fn is_finished(&self) -> bool
Check if the animation is finished (time past last keyframe).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KeyframeAnimator
impl RefUnwindSafe for KeyframeAnimator
impl Send for KeyframeAnimator
impl Sync for KeyframeAnimator
impl Unpin for KeyframeAnimator
impl UnsafeUnpin for KeyframeAnimator
impl UnwindSafe for KeyframeAnimator
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
Mutably borrows from an owned value. Read more
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.