Trait Easing Copy item path Source pub trait Easing: Debug {
// Required method
fn eval (&self, time: f64 ) -> f64 ;
// Provided methods
fn velocity (&self, time: f64 ) -> Option <f64 > { ... }
fn finished (&self, time: f64 ) -> bool { ... }
}Expand description A trait for easing functions used in animations.
Easing functions control how a value changes over time during an animation.
They take a normalized time value (0.0 to 1.0) and return a progress value.
Evaluates the easing function at the given time.
§ Arguments
time - A normalized time value, typically between 0.0 and 1.0
§ Returns
The eased progress value, typically between 0.0 and 1.0
Returns the velocity at the given time, if available.
This is primarily used by spring animations to determine when motion has stopped.
Returns whether the animation has finished at the given time.
By default, an animation is finished when time is outside the 0.0..1.0 range.