pub struct Spring {
pub duration: f32,
pub bounce: f32,
pub rest_distance: f32,
pub rest_speed: f32,
}Expand description
a linear spring tuned by duration and bounce
Fields§
§duration: f32undamped period in seconds controlling the response speed
bounce: f32positive overshoots, zero is critically damped and negative is overdamped
rest_distance: f32§rest_speed: f32Implementations§
Source§impl Spring
impl Spring
Sourcepub fn duration(self, value: f32) -> Self
pub fn duration(self, value: f32) -> Self
sets Self::duration
Sourcepub fn bounce(self, value: f32) -> Self
pub fn bounce(self, value: f32) -> Self
sets Self::bounce
Sourcepub fn rest_distance(self, value: f32) -> Self
pub fn rest_distance(self, value: f32) -> Self
sets Self::rest_distance
Sourcepub fn rest_speed(self, value: f32) -> Self
pub fn rest_speed(self, value: f32) -> Self
sets Self::rest_speed
Trait Implementations§
impl Copy for Spring
impl StructuralPartialEq for Spring
Auto Trait Implementations§
impl Forget for Spring
impl Freeze for Spring
impl Move 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