SmoothInterp

Trait SmoothInterp 

Source
pub trait SmoothInterp: Interp {
    // Required methods
    fn smooth_damp(
        &mut self,
        velocity: &mut Self,
        target: Self,
        smooth_time: Self::Factor,
        max_speed: Self::Factor,
        delta_time: Self::Factor,
    );
    fn smooth_lerp(
        self,
        target: Self,
        t: Self::Factor,
        dt: Self::Factor,
    ) -> Self;
}
Expand description

A type that can smooth damp towards a target.

Required Methods§

Source

fn smooth_damp( &mut self, velocity: &mut Self, target: Self, smooth_time: Self::Factor, max_speed: Self::Factor, delta_time: Self::Factor, )

Accelerate towards a target with stateful velocity.

Source

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

Lerp towards a target with a framerate-invariant version.

See: Lerp Smoothing is Broken.

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

Source§

fn smooth_damp( &mut self, velocity: &mut Self, target: Self, smooth_time: Self::Factor, max_speed: Self::Factor, delta_time: Self::Factor, )

Source§

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

Source§

impl SmoothInterp for f64

Source§

fn smooth_damp( &mut self, velocity: &mut Self, target: Self, smooth_time: Self::Factor, max_speed: Self::Factor, delta_time: Self::Factor, )

Source§

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

Implementors§

Source§

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

Source§

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

Source§

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

Source§

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