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