pub enum Easing {
Bezier([f32; 4]),
Function(fn(f32) -> (f32, f32)),
}Expand description
easing as a cubic bezier or a function
Variants§
Bezier([f32; 4])
control points [x1, y1, x2, y2]
x coordinates are between zero and one and y may overshoot
Function(fn(f32) -> (f32, f32))
receives progress in 0..=1 and returns (value, slope)
value must start at zero and end at one
slope is the derivative with respect to progress
Implementations§
Source§impl Easing
impl Easing
pub const LINEAR: Self
pub const EASE_IN_QUAD: Self
pub const EASE_OUT_QUAD: Self
pub const EASE: Self
pub const EASE_IN: Self
pub const EASE_OUT: Self
pub const EASE_IN_OUT: Self
pub const EASE_IN_CUBIC: Self
pub const EASE_OUT_CUBIC: Self
pub const EASE_IN_OUT_CUBIC: Self
pub const EASE_OUT_EXPO: Self
Trait Implementations§
impl Copy for Easing
Auto Trait Implementations§
impl Forget for Easing
impl Freeze for Easing
impl Move for Easing
impl RefUnwindSafe for Easing
impl Send for Easing
impl Sync for Easing
impl Unpin for Easing
impl UnsafeUnpin for Easing
impl UnwindSafe for Easing
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