pub struct Spring { /* private fields */ }Expand description
A spring-based animator
Implementations§
Source§impl Spring
impl Spring
pub fn new(config: SpringConfig, initial: f32) -> Self
pub fn value(&self) -> f32
pub fn velocity(&self) -> f32
pub fn target(&self) -> f32
pub fn set_target(&mut self, target: f32)
Sourcepub fn is_settled(&self) -> bool
pub fn is_settled(&self) -> bool
Check if the spring has settled (within epsilon of target with minimal velocity)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Spring
impl RefUnwindSafe for Spring
impl Send for Spring
impl Sync for Spring
impl Unpin for Spring
impl UnsafeUnpin for Spring
impl UnwindSafe for Spring
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