Trait Easing

Source
pub trait Easing<F: Float> {
    // Required methods
    fn ease_in(t: F, b: F, c: F, d: F) -> F;
    fn ease_out(t: F, b: F, c: F, d: F) -> F;
    fn ease_in_out(t: F, b: F, c: F, d: F) -> F;
}
Expand description

Interface encapsulating general easing functions

  • t is the current time (or position) of the tween. This can be seconds or frames, steps, seconds, ms, whatever as long as the unit is the same as is used for the total time.
  • b is the beginning value of the property.
  • c is the change between the beginning and destination value of the property.
  • d is the total time of the tween.

Required Methods§

Source

fn ease_in(t: F, b: F, c: F, d: F) -> F

Source

fn ease_out(t: F, b: F, c: F, d: F) -> F

Source

fn ease_in_out(t: F, b: F, c: F, d: F) -> F

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<F: Float + FloatConst> Easing<F> for Elastic

Source§

impl<F: Float + FloatConst> Easing<F> for Sine

Source§

impl<F: Float> Easing<F> for Back

Source§

impl<F: Float> Easing<F> for Bounce

Source§

impl<F: Float> Easing<F> for Circ

Source§

impl<F: Float> Easing<F> for Cubic

Source§

impl<F: Float> Easing<F> for Expo

Source§

impl<F: Float> Easing<F> for Linear

Source§

impl<F: Float> Easing<F> for Quad

Source§

impl<F: Float> Easing<F> for Quart

Source§

impl<F: Float> Easing<F> for Quint