pub trait Animation {
// Required methods
fn tick(&mut self, dt: Duration);
fn is_complete(&self) -> bool;
fn value(&self) -> f32;
fn reset(&mut self);
// Provided method
fn overshoot(&self) -> Duration { ... }
}Expand description
A time-based animation producing values in [0.0, 1.0].
Required Methods§
Sourcefn is_complete(&self) -> bool
fn is_complete(&self) -> bool
Whether the animation has reached its end.
Provided Methods§
Sourcefn overshoot(&self) -> Duration
fn overshoot(&self) -> Duration
Time elapsed past completion. Used by composition types to forward
remaining time (e.g., Sequence forwards overshoot from first to second).
Returns Duration::ZERO for animations that never complete.