Crate soy

Source
Expand description

§Soy

Rust interpolation library.

§Usage

The main trait used for interpolation is [soy::Lerper]. It requires a single method, calculate, which calculates interpolation progression at a given time.

Example implementing linear interpolation, taken directly from soy’s implementation:

struct Linear;

impl soy::Lerper for Linear {
    fn calculate(&self, t: f32) -> {
        t
    }
}

Structs§

Bezier
Unit cubic bezier easing function.
Linear
Linear interpolator: f(t) = t.

Constants§

EASE
Ease function, same as CSS’s “ease” timing-function.
EASE_IN
Ease in function, same as CSS’s “ease-in” timing-function.
EASE_IN_OUT
Ease in-out function, same as CSS’s “ease-in-out” timing-function.
EASE_OUT
Ease out function, same as CSS’s “ease-out” timing-function.

Traits§

Lerper
Trait implemented by all interpolating methods.

Functions§

cubic_bezier
Wrapper around Bezier::new.
lerp
Interpolate between two values given an interpolation method.