Skip to main content

Lerp

Trait Lerp 

Source
pub trait Lerp: Copy + PartialEq {
    // Required method
    fn lerp(self, other: Self, t: f32) -> Self;
}
Expand description

Tween-able value. Implementations should return a linear interpolation between self and other at fraction t in [0, 1]. Implementations are free to assume t is already easing-adjusted by Easing::apply.

Required Methods§

Source

fn lerp(self, other: Self, t: f32) -> Self

Linear interpolation between self (at t = 0) and other (at t = 1).

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.

Implementations on Foreign Types§

Source§

impl Lerp for f32

Source§

fn lerp(self, other: Self, t: f32) -> Self

Source§

impl Lerp for Color

Source§

fn lerp(self, other: Self, t: f32) -> Self

Implementors§