Trait cogs_gamedev::ease::Interpolator[][src]

pub trait Interpolator<Value>: Float + FloatConst {
    fn lerp(self, start: Value, end: Value) -> Value;

    fn sine_in(self, start: Value, end: Value) -> Value { ... }
fn sine_out(self, start: Value, end: Value) -> Value { ... }
fn sine_in_out(self, start: Value, end: Value) -> Value { ... }
fn quad_in(self, start: Value, end: Value) -> Value { ... }
fn quad_out(self, start: Value, end: Value) -> Value { ... }
fn quad_in_out(self, start: Value, end: Value) -> Value { ... } }
Expand description

Trait for things that can interpolate values.

See this handy cheatsheet.

Required methods

Get a value self% between start and end. self being 0 should mean all the way at start; self being 1 means all the way at end. The implementation must accept values outside of 0 and 1, however, for easing functions like elastic_in.

All the easing functions are defined in terms of this function. An equation is run on self to get a modified value, and the modified value has lerp called on it.

Provided methods

Implementors