Skip to main content

Slerp

Trait Slerp 

Source
pub trait Slerp<Factor = f32>: Sized {
    type Output;

    // Required method
    fn slerp_unclamped(from: Self, to: Self, factor: Factor) -> Self::Output;

    // Provided method
    fn slerp(from: Self, to: Self, factor: Factor) -> Self::Output
       where Factor: Clamp + Zero + One { ... }
}
Expand description

A value that can be Spherically Linearly interpolated.

The Output type allows this trait to be meaningfully implemented for &T as well as T.

Required Associated Types§

Source

type Output

The resulting type after performing the SLERP operation.

Required Methods§

Source

fn slerp_unclamped(from: Self, to: Self, factor: Factor) -> Self::Output

Performs spherical linear interpolation without implictly constraining factor to be between 0 and 1.

Provided Methods§

Source

fn slerp(from: Self, to: Self, factor: Factor) -> Self::Output
where Factor: Clamp + Zero + One,

Performs spherical linear interpolation, constraining factor to be between 0 and 1.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'a, T, Factor> Slerp<Factor> for &'a Quaternion<T>
where T: Lerp<T, Output = T> + Add<Output = T> + Real, Factor: Into<T>,

Source§

impl<T, Factor> Slerp<Factor> for Quaternion<T>
where T: Lerp<T, Output = T> + Add<Output = T> + Real, Factor: Into<T>,

Source§

impl<T> Slerp<T> for Vec3<T>
where T: Real<Output = T> + Clamp + Lerp<T, Output = T> + Add,