pub struct ContinuousWithMomentum { /* private fields */ }Expand description
Implementations§
Source§impl ContinuousWithMomentum
impl ContinuousWithMomentum
Sourcepub fn friction(self, friction: f64) -> Self
pub fn friction(self, friction: f64) -> Self
Set the friction that damps movement
Typical values are 0.05-0.15. Higher = more friction = stops faster.
Sourcepub const fn minimum_velocity(self, min_vel: f64) -> Self
pub const fn minimum_velocity(self, min_vel: f64) -> Self
Set the minimum velocity threshold
When velocity drops below this, animation stops. Default is 0.05.
Trait Implementations§
Source§impl Clone for ContinuousWithMomentum
impl Clone for ContinuousWithMomentum
Source§fn clone(&self) -> ContinuousWithMomentum
fn clone(&self) -> ContinuousWithMomentum
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ContinuousWithMomentum
impl Debug for ContinuousWithMomentum
Source§impl Default for ContinuousWithMomentum
impl Default for ContinuousWithMomentum
Source§impl MomentumBehavior for ContinuousWithMomentum
impl MomentumBehavior for ContinuousWithMomentum
Source§fn released_with_velocity(&mut self, _position: f64, velocity: f64)
fn released_with_velocity(&mut self, _position: f64, velocity: f64)
Called when the drag is released with a velocity (units per second)
Source§fn next_position(&mut self, current_position: f64, elapsed_seconds: f64) -> f64
fn next_position(&mut self, current_position: f64, elapsed_seconds: f64) -> f64
Get the next position after elapsed time
This should also update internal state (like decaying velocity)
Source§fn is_stopped(&self, _position: f64) -> bool
fn is_stopped(&self, _position: f64) -> bool
Check if the animation has stopped
Auto Trait Implementations§
impl Freeze for ContinuousWithMomentum
impl RefUnwindSafe for ContinuousWithMomentum
impl Send for ContinuousWithMomentum
impl Sync for ContinuousWithMomentum
impl Unpin for ContinuousWithMomentum
impl UnsafeUnpin for ContinuousWithMomentum
impl UnwindSafe for ContinuousWithMomentum
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