pub struct Animation {
pub property: AnimatedProperty,
pub keyframes: Vec<Keyframe>,
pub easing: Easing,
pub repeat: Repeat,
}Expand description
A keyframe track on one property.
Fields§
§property: AnimatedProperty§keyframes: Vec<Keyframe>§easing: Easing§repeat: RepeatImplementations§
Source§impl Animation
impl Animation
Sourcepub fn new(
property: AnimatedProperty,
keyframes: Vec<Keyframe>,
easing: Easing,
repeat: Repeat,
) -> Self
pub fn new( property: AnimatedProperty, keyframes: Vec<Keyframe>, easing: Easing, repeat: Repeat, ) -> Self
Build an animation from a property + an unordered keyframe list. The constructor sorts keyframes by time.
Sourcepub fn sample(&self, t: TimeStamp) -> Option<KeyframeValue>
pub fn sample(&self, t: TimeStamp) -> Option<KeyframeValue>
Evaluate the animation at scene time t. Returns None if
the animation has no keyframes. For Repeat::Once, times
before the first keyframe clamp to the first value; times
after the last clamp to the last value.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Animation
impl RefUnwindSafe for Animation
impl Send for Animation
impl Sync for Animation
impl Unpin for Animation
impl UnsafeUnpin for Animation
impl UnwindSafe for Animation
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