Interp

Trait Interp 

Source
pub trait Interp {
    type Factor;

    // Required methods
    fn lerp(self, target: Self, t: Self::Factor) -> Self;
    fn quad_bezier(self, control: Self, target: Self, t: Self::Factor) -> Self;
    fn cubic_bezier(
        self,
        control1: Self,
        control2: Self,
        target: Self,
        t: Self::Factor,
    ) -> Self;
    fn hermite(
        self,
        tangent1: Self::Factor,
        target: Self,
        tangent2: Self::Factor,
        t: Self::Factor,
    ) -> Self;
    fn catmull_rom(
        self,
        control1: Self,
        control2: Self,
        target: Self,
        t: Self::Factor,
    ) -> Self;
    fn smooth_step(self, target: Self, t: Self::Factor) -> Self;
}
Expand description

A type that can be interpolated.

Required Associated Types§

Source

type Factor

The factor by which this type is interpolated.

Required Methods§

Source

fn lerp(self, target: Self, t: Self::Factor) -> Self

Linear interpolation.

Source

fn quad_bezier(self, control: Self, target: Self, t: Self::Factor) -> Self

Quadratic bezier interpolation.

Source

fn cubic_bezier( self, control1: Self, control2: Self, target: Self, t: Self::Factor, ) -> Self

Cubic bezier interpolation.

Source

fn hermite( self, tangent1: Self::Factor, target: Self, tangent2: Self::Factor, t: Self::Factor, ) -> Self

Source

fn catmull_rom( self, control1: Self, control2: Self, target: Self, t: Self::Factor, ) -> Self

Source

fn smooth_step(self, target: Self, t: Self::Factor) -> Self

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 Interp for f32

Source§

type Factor = f32

Source§

fn lerp(self, target: Self, t: Self::Factor) -> Self

Source§

fn quad_bezier(self, control: Self, target: Self, t: Self::Factor) -> Self

Source§

fn cubic_bezier( self, control1: Self, control2: Self, target: Self, t: Self::Factor, ) -> Self

Source§

fn hermite( self, tangent1: Self::Factor, target: Self, tangent2: Self::Factor, t: Self::Factor, ) -> Self

Source§

fn catmull_rom( self, control1: Self, control2: Self, target: Self, t: Self::Factor, ) -> Self

Source§

fn smooth_step(self, target: Self, t: Self::Factor) -> Self

Source§

impl Interp for f64

Source§

type Factor = f64

Source§

fn lerp(self, target: Self, t: Self::Factor) -> Self

Source§

fn quad_bezier(self, control: Self, target: Self, t: Self::Factor) -> Self

Source§

fn cubic_bezier( self, control1: Self, control2: Self, target: Self, t: Self::Factor, ) -> Self

Source§

fn hermite( self, tangent1: Self::Factor, target: Self, tangent2: Self::Factor, t: Self::Factor, ) -> Self

Source§

fn catmull_rom( self, control1: Self, control2: Self, target: Self, t: Self::Factor, ) -> Self

Source§

fn smooth_step(self, target: Self, t: Self::Factor) -> Self

Implementors§

Source§

impl<T: Float + Interp<Factor = T>> Interp for Rect<T>

Source§

impl<T: Float + Interp<Factor = T>> Interp for Vec2<T>

Source§

impl<T: Float + Interp<Factor = T>> Interp for Vec3<T>

Source§

impl<T: Float + Interp<Factor = T>> Interp for Vec4<T>

Source§

impl<T: Float> Interp for Line<T>
where Vec2<T>: Interp<Factor = T>,

Source§

impl<T: Float> Interp for Quad<T>
where Vec2<T>: Interp<Factor = T>,

Source§

impl<T: Float> Interp for Triangle<T>
where Vec2<T>: Interp<Factor = T>,