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§
Required Methods§
Sourcefn quad_bezier(self, control: Self, target: Self, t: Self::Factor) -> Self
fn quad_bezier(self, control: Self, target: Self, t: Self::Factor) -> Self
Quadratic bezier interpolation.
Sourcefn cubic_bezier(
self,
control1: Self,
control2: Self,
target: Self,
t: Self::Factor,
) -> Self
fn cubic_bezier( self, control1: Self, control2: Self, target: Self, t: Self::Factor, ) -> Self
Cubic bezier interpolation.
Sourcefn hermite(
self,
tangent1: Self::Factor,
target: Self,
tangent2: Self::Factor,
t: Self::Factor,
) -> Self
fn hermite( self, tangent1: Self::Factor, target: Self, tangent2: Self::Factor, t: Self::Factor, ) -> Self
Cubic Hermite1 interpolation.
Sourcefn catmull_rom(
self,
control1: Self,
control2: Self,
target: Self,
t: Self::Factor,
) -> Self
fn catmull_rom( self, control1: Self, control2: Self, target: Self, t: Self::Factor, ) -> Self
Catmull-Rom1 interpolation.
Sourcefn smooth_step(self, target: Self, t: Self::Factor) -> Self
fn smooth_step(self, target: Self, t: Self::Factor) -> Self
Smooth-step1 interpolation.
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.