pub struct Spring {
pub mass: f32,
pub stiffness: f32,
pub damping: f32,
/* private fields */
}
Fields§
§mass: f32
§stiffness: f32
§damping: f32
Implementations§
source§impl Spring
impl Spring
pub fn new(mass: f32, stiffness: f32, damping: f32) -> Self
pub fn new_with_velocity( mass: f32, stiffness: f32, damping: f32, initial_velocity: f32, ) -> Self
pub fn with_duration_and_bounce(duration: f32, bounce: f32) -> Self
pub fn with_duration_bounce_and_velocity( duration: f32, bounce: f32, initial_velocity: f32, ) -> Self
pub fn update_pos_vel_at(&self, t: f32) -> (f32, f32)
pub fn update_at(&mut self, elapsed: f32) -> f32
pub fn done(&self, elapsed: f32) -> bool
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 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more