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.

Object Safety§

This trait is not object safe.

Implementors§

source§

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

source§

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

source§

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

§

type Output = Vec3<T>

source§

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

§

type Output = Vec3<T>

source§

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

source§

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