pub enum Easing {
Show 41 variants
Linear,
EaseInQuad,
EaseOutQuad,
EaseInOutQuad,
EaseInCubic,
EaseOutCubic,
EaseInOutCubic,
EaseInQuart,
EaseOutQuart,
EaseInOutQuart,
EaseInQuint,
EaseOutQuint,
EaseInOutQuint,
EaseInSine,
EaseOutSine,
EaseInOutSine,
EaseInExpo,
EaseOutExpo,
EaseInOutExpo,
EaseInCirc,
EaseOutCirc,
EaseInOutCirc,
EaseInBack,
EaseOutBack,
EaseInOutBack,
EaseInElastic,
EaseOutElastic,
EaseInOutElastic,
EaseInBounce,
EaseOutBounce,
EaseInOutBounce,
SmoothStep,
SmootherStep,
Step,
EaseOutLinear,
Hermite {
p0: f32,
m0: f32,
p1: f32,
m1: f32,
},
Power(f32),
Sigmoid {
k: f32,
},
Spring {
stiffness: f32,
damping: f32,
},
Parabola,
Flash,
}Expand description
An easing function — transforms normalized time t ∈ [0, 1] → output ∈ [0, 1].
For typical usage, In = slow start, Out = slow end, InOut = slow at both ends.
Variants§
Linear
EaseInQuad
EaseOutQuad
EaseInOutQuad
EaseInCubic
EaseOutCubic
EaseInOutCubic
EaseInQuart
EaseOutQuart
EaseInOutQuart
EaseInQuint
EaseOutQuint
EaseInOutQuint
EaseInSine
EaseOutSine
EaseInOutSine
EaseInExpo
EaseOutExpo
EaseInOutExpo
EaseInCirc
EaseOutCirc
EaseInOutCirc
EaseInBack
EaseOutBack
EaseInOutBack
EaseInElastic
EaseOutElastic
EaseInOutElastic
EaseInBounce
EaseOutBounce
EaseInOutBounce
SmoothStep
Smooth step: 3t² - 2t³ (zero derivative at endpoints).
SmootherStep
Smoother step: 6t⁵ - 15t⁴ + 10t³ (Perlin’s improved smoothstep).
Step
Step at threshold 0.5 (instantaneous jump).
EaseOutLinear
Instant-in, linear-out.
Hermite
Hermite cubic through two tangents.
Power(f32)
Custom power: t^n.
Sigmoid
Sigmoid (logistic) curve.
Spring
Spring easing (underdamped oscillation to rest).
Parabola
Parabolic arc (projectile).
Flash
Flash: instant full, then linear decay.
Implementations§
Trait Implementations§
impl Copy for Easing
impl StructuralPartialEq for Easing
Auto Trait Implementations§
impl Freeze 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