FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    Spring

    struct · ferroui-base · v0.5.0

    struct Spring
    

    Determines how an animation is used based on spring formula.

    View source

    Members

    new

    fn new() -> Self
    

    Creates a spring with all parameters zero.

    Source

    with_values

    fn with_values(mass: f64, stiffness: f64, damping: f64, initial_velocity: f64) -> Self
    

    Creates a spring with the given parameters.

    Source

    parse

    fn parse(value: &str) -> Result<Spring, FormatError>
    

    Parses a spring from four numbers: mass, stiffness, damping and initial velocity.

    Source

    mass

    fn mass(self: &Self) -> f64
    

    The spring mass.

    Source

    set_mass

    fn set_mass(self: &Self, value: f64)
    

    Source

    stiffness

    fn stiffness(self: &Self) -> f64
    

    The spring stiffness.

    Source

    set_stiffness

    fn set_stiffness(self: &Self, value: f64)
    

    Source

    damping

    fn damping(self: &Self) -> f64
    

    The spring damping.

    Source

    set_damping

    fn set_damping(self: &Self, value: f64)
    

    Source

    initial_velocity

    fn initial_velocity(self: &Self) -> f64
    

    The spring initial velocity.

    Source

    set_initial_velocity

    fn set_initial_velocity(self: &Self, value: f64)
    

    Source

    get_spring_progress

    fn get_spring_progress(self: &Self, linear_progress: f64) -> f64
    

    Calculates the spring progress from a linear progress.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • AnyValue
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ErasedDestructor
    • IntoEither
    • PartialEq
    • Default
    • FromStr

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.