pub struct Spring { /* private fields */ }Expand description
Determines how an animation is used based on spring formula.
Implementations§
Source§impl Spring
impl Spring
Sourcepub fn with_values(
mass: f64,
stiffness: f64,
damping: f64,
initial_velocity: f64,
) -> Self
pub fn with_values( mass: f64, stiffness: f64, damping: f64, initial_velocity: f64, ) -> Self
Creates a spring with the given parameters.
Sourcepub fn parse(value: &str) -> Result<Spring, FormatError>
pub fn parse(value: &str) -> Result<Spring, FormatError>
Parses a spring from four numbers: mass, stiffness, damping and initial velocity.
pub fn set_mass(&self, value: f64)
pub fn set_stiffness(&self, value: f64)
pub fn set_damping(&self, value: f64)
Sourcepub fn initial_velocity(&self) -> f64
pub fn initial_velocity(&self) -> f64
The spring initial velocity.
pub fn set_initial_velocity(&self, value: f64)
Sourcepub fn get_spring_progress(&self, linear_progress: f64) -> f64
pub fn get_spring_progress(&self, linear_progress: f64) -> f64
Calculates the spring progress from a linear progress.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Spring
impl !RefUnwindSafe for Spring
impl !Sync for Spring
impl Send for Spring
impl Unpin for Spring
impl UnsafeUnpin for Spring
impl UnwindSafe for Spring
Blanket Implementations§
Source§impl<T> AnyValue for Twhere
T: PartialEq + 'static,
impl<T> AnyValue for Twhere
T: PartialEq + 'static,
fn any_value_as_any(&self) -> &(dyn Any + 'static)
fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool
fn any_value_type_name(&self) -> &'static str
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> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
The static constructor of a type: work done once per thread, after
the properties of the type are registered and before its first
instance exists (class handlers,
affects_render, metadata
overrides). Read more