pub struct Spring {
pub value: f32,
pub target: f32,
pub velocity: f32,
pub stiffness: f32,
pub damping: f32,
}Expand description
A critically-dampable spring (implicit-ish) — great for snappy UI motion.
stiffness ≈ how hard it pulls toward the target, damping ≈ how fast it
settles. Step with update(dt) each frame.
Fields§
§value: f32§target: f32§velocity: f32§stiffness: f32§damping: f32Implementations§
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