Trait Lerp

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

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

    // Provided methods
    fn lerp_unclamped_inclusive_range(
        range: RangeInclusive<Self>,
        factor: Factor,
    ) -> Self::Output { ... }
    fn lerp_unclamped_precise(
        from: Self,
        to: Self,
        factor: Factor,
    ) -> Self::Output { ... }
    fn lerp_unclamped_precise_inclusive_range(
        range: RangeInclusive<Self>,
        factor: Factor,
    ) -> Self::Output { ... }
    fn lerp(from: Self, to: Self, factor: Factor) -> Self::Output
       where Factor: Clamp + Zero + One { ... }
    fn lerp_inclusive_range(
        range: RangeInclusive<Self>,
        factor: Factor,
    ) -> Self::Output
       where Factor: Clamp + Zero + One { ... }
    fn lerp_precise(from: Self, to: Self, factor: Factor) -> Self::Output
       where Factor: Clamp + Zero + One { ... }
    fn lerp_precise_inclusive_range(
        range: RangeInclusive<Self>,
        factor: Factor,
    ) -> Self::Output
       where Factor: Clamp + Zero + One { ... }
}
Expand description

A value that can be linearly interpolated.

Note that, like standard operators, this can be implement for T and &T. You would make the difference like so:

use vek::ops::Lerp;

let a = Lerp::lerp(0, 10, 0.5_f32);
let b = Lerp::lerp(&0, &10, 0.5_f32);
let c = i32::lerp(0, 10, 0.5_f32);
let d = <&i32>::lerp(&0, &10, 0.5_f32);
assert_eq!(a, b);
assert_eq!(a, c);
assert_eq!(a, d);

This is made possible thanks to the explicit Output type. Therefore, it’s also convenient for GameState structures, which you might prefer to interpolate by reference instead of consuming them. The interpolation of two &GameStates would produce a new GameState value.

use vek::{Lerp, Vec3};

/// A data-heavy structure that represents a current game state.
/// It's neither Copy and nor even Clone!
struct GameState {
    pub camera_position: Vec3<f32>,
    // ... obviously a lot of other members following ...
}
// We can select the Progress type. I chose f64; the default is f32.
impl<'a> Lerp<f64> for &'a GameState {
    type Output = GameState;
    fn lerp_unclamped(a: Self, b: Self, t: f64) -> GameState {
        GameState {
            camera_position: Lerp::lerp(a.camera_position, b.camera_position, t as f32),
            // ... etc for all relevant members...
        }
    }
}
let a = GameState { camera_position: Vec3::zero() };
let b = GameState { camera_position: Vec3::unit_x() };
let c = Lerp::lerp(&a, &b, 0.5);
// Hurray! We've got an interpolated state without consuming the two previous ones.

Required Associated Types§

Source

type Output

The resulting type after performing the LERP operation.

Required Methods§

Source

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

Returns the linear interpolation of from to to with factor unconstrained, using the supposedly fastest but less precise implementation.

A possible implementation is from + factor * (to - from), a.k.a factor.mul_add(to - from, from).

use vek::ops::Lerp;

assert_eq!(Lerp::lerp_unclamped(10, 20, -1.0_f32),  0);
assert_eq!(Lerp::lerp_unclamped(10, 20, -0.5_f32),  5);
assert_eq!(Lerp::lerp_unclamped(10, 20,  0.0_f32), 10);
assert_eq!(Lerp::lerp_unclamped(10, 20,  0.5_f32), 15);
assert_eq!(Lerp::lerp_unclamped(10, 20,  1.0_f32), 20);
assert_eq!(Lerp::lerp_unclamped(10, 20,  1.5_f32), 25);

Provided Methods§

Source

fn lerp_unclamped_inclusive_range( range: RangeInclusive<Self>, factor: Factor, ) -> Self::Output

Version of lerp_unclamped() that used a single RangeInclusive parameter instead of two values.

Source

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

Returns the linear interpolation of from to to with factor unconstrained, using a possibly slower but more precise operation.

A possible implementation is from*(1-factor) + to*factor, a.k.a from.mul_add(1-factor, to*factor).

use vek::ops::Lerp;

assert_eq!(Lerp::lerp_unclamped_precise(10, 20, -1.0_f32),  0);
assert_eq!(Lerp::lerp_unclamped_precise(10, 20, -0.5_f32),  5);
assert_eq!(Lerp::lerp_unclamped_precise(10, 20,  0.0_f32), 10);
assert_eq!(Lerp::lerp_unclamped_precise(10, 20,  0.5_f32), 15);
assert_eq!(Lerp::lerp_unclamped_precise(10, 20,  1.0_f32), 20);
assert_eq!(Lerp::lerp_unclamped_precise(10, 20,  1.5_f32), 25);
Source

fn lerp_unclamped_precise_inclusive_range( range: RangeInclusive<Self>, factor: Factor, ) -> Self::Output

Version of lerp_unclamped_precise() that used a single RangeInclusive parameter instead of two values.

Source

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

Alias to lerp_unclamped which constrains factor to be between 0 and 1 (inclusive).

use vek::ops::Lerp;

assert_eq!(Lerp::lerp(10, 20, -1.0_f32), 10);
assert_eq!(Lerp::lerp(10, 20, -0.5_f32), 10);
assert_eq!(Lerp::lerp(10, 20,  0.0_f32), 10);
assert_eq!(Lerp::lerp(10, 20,  0.5_f32), 15);
assert_eq!(Lerp::lerp(10, 20,  1.0_f32), 20);
assert_eq!(Lerp::lerp(10, 20,  1.5_f32), 20);
Source

fn lerp_inclusive_range( range: RangeInclusive<Self>, factor: Factor, ) -> Self::Output
where Factor: Clamp + Zero + One,

Version of lerp() that used a single RangeInclusive parameter instead of two values.

Source

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

Alias to lerp_unclamped_precise which constrains factor to be between 0 and 1 (inclusive).

use vek::ops::Lerp;

assert_eq!(Lerp::lerp_precise(10, 20, -1.0_f32), 10);
assert_eq!(Lerp::lerp_precise(10, 20, -0.5_f32), 10);
assert_eq!(Lerp::lerp_precise(10, 20,  0.0_f32), 10);
assert_eq!(Lerp::lerp_precise(10, 20,  0.5_f32), 15);
assert_eq!(Lerp::lerp_precise(10, 20,  1.0_f32), 20);
assert_eq!(Lerp::lerp_precise(10, 20,  1.5_f32), 20);
Source

fn lerp_precise_inclusive_range( range: RangeInclusive<Self>, factor: Factor, ) -> Self::Output
where Factor: Clamp + Zero + One,

Version of lerp_precise() that used a single RangeInclusive parameter instead of two values.

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

Source§

type Output = f32

Source§

fn lerp_unclamped_precise(from: f32, to: f32, factor: f32) -> f32

Source§

fn lerp_unclamped(from: f32, to: f32, factor: f32) -> f32

Source§

impl Lerp for i8

Source§

type Output = i8

Source§

fn lerp_unclamped_precise(from: i8, to: i8, factor: f32) -> i8

Source§

fn lerp_unclamped(from: i8, to: i8, factor: f32) -> i8

Source§

impl Lerp for i16

Source§

type Output = i16

Source§

fn lerp_unclamped_precise(from: i16, to: i16, factor: f32) -> i16

Source§

fn lerp_unclamped(from: i16, to: i16, factor: f32) -> i16

Source§

impl Lerp for i32

Source§

type Output = i32

Source§

fn lerp_unclamped_precise(from: i32, to: i32, factor: f32) -> i32

Source§

fn lerp_unclamped(from: i32, to: i32, factor: f32) -> i32

Source§

impl Lerp for i64

Source§

type Output = i64

Source§

fn lerp_unclamped_precise(from: i64, to: i64, factor: f32) -> i64

Source§

fn lerp_unclamped(from: i64, to: i64, factor: f32) -> i64

Source§

impl Lerp for isize

Source§

impl Lerp for u8

Source§

type Output = u8

Source§

fn lerp_unclamped_precise(from: u8, to: u8, factor: f32) -> u8

Source§

fn lerp_unclamped(from: u8, to: u8, factor: f32) -> u8

Source§

impl Lerp for u16

Source§

type Output = u16

Source§

fn lerp_unclamped_precise(from: u16, to: u16, factor: f32) -> u16

Source§

fn lerp_unclamped(from: u16, to: u16, factor: f32) -> u16

Source§

impl Lerp for u32

Source§

type Output = u32

Source§

fn lerp_unclamped_precise(from: u32, to: u32, factor: f32) -> u32

Source§

fn lerp_unclamped(from: u32, to: u32, factor: f32) -> u32

Source§

impl Lerp for u64

Source§

type Output = u64

Source§

fn lerp_unclamped_precise(from: u64, to: u64, factor: f32) -> u64

Source§

fn lerp_unclamped(from: u64, to: u64, factor: f32) -> u64

Source§

impl Lerp for usize

Source§

impl Lerp for Path

Source§

type Output = Path

Source§

fn lerp_unclamped(from: Path, to: Path, factor: f32) -> <Path as Lerp>::Output

Source§

impl Lerp<f64> for f64

Source§

type Output = f64

Source§

fn lerp_unclamped_precise(from: f64, to: f64, factor: f64) -> f64

Source§

fn lerp_unclamped(from: f64, to: f64, factor: f64) -> f64

Source§

impl Lerp<f64> for i8

Source§

type Output = i8

Source§

fn lerp_unclamped_precise(from: i8, to: i8, factor: f64) -> i8

Source§

fn lerp_unclamped(from: i8, to: i8, factor: f64) -> i8

Source§

impl Lerp<f64> for i16

Source§

type Output = i16

Source§

fn lerp_unclamped_precise(from: i16, to: i16, factor: f64) -> i16

Source§

fn lerp_unclamped(from: i16, to: i16, factor: f64) -> i16

Source§

impl Lerp<f64> for i32

Source§

type Output = i32

Source§

fn lerp_unclamped_precise(from: i32, to: i32, factor: f64) -> i32

Source§

fn lerp_unclamped(from: i32, to: i32, factor: f64) -> i32

Source§

impl Lerp<f64> for i64

Source§

type Output = i64

Source§

fn lerp_unclamped_precise(from: i64, to: i64, factor: f64) -> i64

Source§

fn lerp_unclamped(from: i64, to: i64, factor: f64) -> i64

Source§

impl Lerp<f64> for isize

Source§

impl Lerp<f64> for u8

Source§

type Output = u8

Source§

fn lerp_unclamped_precise(from: u8, to: u8, factor: f64) -> u8

Source§

fn lerp_unclamped(from: u8, to: u8, factor: f64) -> u8

Source§

impl Lerp<f64> for u16

Source§

type Output = u16

Source§

fn lerp_unclamped_precise(from: u16, to: u16, factor: f64) -> u16

Source§

fn lerp_unclamped(from: u16, to: u16, factor: f64) -> u16

Source§

impl Lerp<f64> for u32

Source§

type Output = u32

Source§

fn lerp_unclamped_precise(from: u32, to: u32, factor: f64) -> u32

Source§

fn lerp_unclamped(from: u32, to: u32, factor: f64) -> u32

Source§

impl Lerp<f64> for u64

Source§

type Output = u64

Source§

fn lerp_unclamped_precise(from: u64, to: u64, factor: f64) -> u64

Source§

fn lerp_unclamped(from: u64, to: u64, factor: f64) -> u64

Source§

impl Lerp<f64> for usize

Source§

impl<'a> Lerp for &'a f32

Source§

type Output = f32

Source§

fn lerp_unclamped_precise(from: &'a f32, to: &'a f32, factor: f32) -> f32

Source§

fn lerp_unclamped(from: &'a f32, to: &'a f32, factor: f32) -> f32

Source§

impl<'a> Lerp for &'a i8

Source§

type Output = i8

Source§

fn lerp_unclamped_precise(from: &'a i8, to: &'a i8, factor: f32) -> i8

Source§

fn lerp_unclamped(from: &'a i8, to: &'a i8, factor: f32) -> i8

Source§

impl<'a> Lerp for &'a i16

Source§

type Output = i16

Source§

fn lerp_unclamped_precise(from: &'a i16, to: &'a i16, factor: f32) -> i16

Source§

fn lerp_unclamped(from: &'a i16, to: &'a i16, factor: f32) -> i16

Source§

impl<'a> Lerp for &'a i32

Source§

type Output = i32

Source§

fn lerp_unclamped_precise(from: &'a i32, to: &'a i32, factor: f32) -> i32

Source§

fn lerp_unclamped(from: &'a i32, to: &'a i32, factor: f32) -> i32

Source§

impl<'a> Lerp for &'a i64

Source§

type Output = i64

Source§

fn lerp_unclamped_precise(from: &'a i64, to: &'a i64, factor: f32) -> i64

Source§

fn lerp_unclamped(from: &'a i64, to: &'a i64, factor: f32) -> i64

Source§

impl<'a> Lerp for &'a isize

Source§

type Output = isize

Source§

fn lerp_unclamped_precise(from: &'a isize, to: &'a isize, factor: f32) -> isize

Source§

fn lerp_unclamped(from: &'a isize, to: &'a isize, factor: f32) -> isize

Source§

impl<'a> Lerp for &'a u8

Source§

type Output = u8

Source§

fn lerp_unclamped_precise(from: &'a u8, to: &'a u8, factor: f32) -> u8

Source§

fn lerp_unclamped(from: &'a u8, to: &'a u8, factor: f32) -> u8

Source§

impl<'a> Lerp for &'a u16

Source§

type Output = u16

Source§

fn lerp_unclamped_precise(from: &'a u16, to: &'a u16, factor: f32) -> u16

Source§

fn lerp_unclamped(from: &'a u16, to: &'a u16, factor: f32) -> u16

Source§

impl<'a> Lerp for &'a u32

Source§

type Output = u32

Source§

fn lerp_unclamped_precise(from: &'a u32, to: &'a u32, factor: f32) -> u32

Source§

fn lerp_unclamped(from: &'a u32, to: &'a u32, factor: f32) -> u32

Source§

impl<'a> Lerp for &'a u64

Source§

type Output = u64

Source§

fn lerp_unclamped_precise(from: &'a u64, to: &'a u64, factor: f32) -> u64

Source§

fn lerp_unclamped(from: &'a u64, to: &'a u64, factor: f32) -> u64

Source§

impl<'a> Lerp for &'a usize

Source§

type Output = usize

Source§

fn lerp_unclamped_precise(from: &'a usize, to: &'a usize, factor: f32) -> usize

Source§

fn lerp_unclamped(from: &'a usize, to: &'a usize, factor: f32) -> usize

Source§

impl<'a> Lerp<f64> for &'a f64

Source§

type Output = f64

Source§

fn lerp_unclamped_precise(from: &'a f64, to: &'a f64, factor: f64) -> f64

Source§

fn lerp_unclamped(from: &'a f64, to: &'a f64, factor: f64) -> f64

Source§

impl<'a> Lerp<f64> for &'a i8

Source§

type Output = i8

Source§

fn lerp_unclamped_precise(from: &'a i8, to: &'a i8, factor: f64) -> i8

Source§

fn lerp_unclamped(from: &'a i8, to: &'a i8, factor: f64) -> i8

Source§

impl<'a> Lerp<f64> for &'a i16

Source§

type Output = i16

Source§

fn lerp_unclamped_precise(from: &'a i16, to: &'a i16, factor: f64) -> i16

Source§

fn lerp_unclamped(from: &'a i16, to: &'a i16, factor: f64) -> i16

Source§

impl<'a> Lerp<f64> for &'a i32

Source§

type Output = i32

Source§

fn lerp_unclamped_precise(from: &'a i32, to: &'a i32, factor: f64) -> i32

Source§

fn lerp_unclamped(from: &'a i32, to: &'a i32, factor: f64) -> i32

Source§

impl<'a> Lerp<f64> for &'a i64

Source§

type Output = i64

Source§

fn lerp_unclamped_precise(from: &'a i64, to: &'a i64, factor: f64) -> i64

Source§

fn lerp_unclamped(from: &'a i64, to: &'a i64, factor: f64) -> i64

Source§

impl<'a> Lerp<f64> for &'a isize

Source§

type Output = isize

Source§

fn lerp_unclamped_precise(from: &'a isize, to: &'a isize, factor: f64) -> isize

Source§

fn lerp_unclamped(from: &'a isize, to: &'a isize, factor: f64) -> isize

Source§

impl<'a> Lerp<f64> for &'a u8

Source§

type Output = u8

Source§

fn lerp_unclamped_precise(from: &'a u8, to: &'a u8, factor: f64) -> u8

Source§

fn lerp_unclamped(from: &'a u8, to: &'a u8, factor: f64) -> u8

Source§

impl<'a> Lerp<f64> for &'a u16

Source§

type Output = u16

Source§

fn lerp_unclamped_precise(from: &'a u16, to: &'a u16, factor: f64) -> u16

Source§

fn lerp_unclamped(from: &'a u16, to: &'a u16, factor: f64) -> u16

Source§

impl<'a> Lerp<f64> for &'a u32

Source§

type Output = u32

Source§

fn lerp_unclamped_precise(from: &'a u32, to: &'a u32, factor: f64) -> u32

Source§

fn lerp_unclamped(from: &'a u32, to: &'a u32, factor: f64) -> u32

Source§

impl<'a> Lerp<f64> for &'a u64

Source§

type Output = u64

Source§

fn lerp_unclamped_precise(from: &'a u64, to: &'a u64, factor: f64) -> u64

Source§

fn lerp_unclamped(from: &'a u64, to: &'a u64, factor: f64) -> u64

Source§

impl<'a> Lerp<f64> for &'a usize

Source§

type Output = usize

Source§

fn lerp_unclamped_precise(from: &'a usize, to: &'a usize, factor: f64) -> usize

Source§

fn lerp_unclamped(from: &'a usize, to: &'a usize, factor: f64) -> usize

Source§

impl<'a, Factor> Lerp<Factor> for &'a ArthropodSkeleton
where Factor: Copy, Transform<f32, f32, f32>: Lerp<Factor, Output = Transform<f32, f32, f32>>,

Source§

type Output = ArthropodSkeleton

Source§

fn lerp_unclamped_precise( from: &'a ArthropodSkeleton, to: &'a ArthropodSkeleton, factor: Factor, ) -> <&'a ArthropodSkeleton as Lerp<Factor>>::Output

Source§

fn lerp_unclamped( from: &'a ArthropodSkeleton, to: &'a ArthropodSkeleton, factor: Factor, ) -> <&'a ArthropodSkeleton as Lerp<Factor>>::Output

Source§

impl<'a, Factor> Lerp<Factor> for &'a BipedLargeSkeleton
where Factor: Copy, Transform<f32, f32, f32>: Lerp<Factor, Output = Transform<f32, f32, f32>>,

Source§

type Output = BipedLargeSkeleton

Source§

fn lerp_unclamped_precise( from: &'a BipedLargeSkeleton, to: &'a BipedLargeSkeleton, factor: Factor, ) -> <&'a BipedLargeSkeleton as Lerp<Factor>>::Output

Source§

fn lerp_unclamped( from: &'a BipedLargeSkeleton, to: &'a BipedLargeSkeleton, factor: Factor, ) -> <&'a BipedLargeSkeleton as Lerp<Factor>>::Output

Source§

impl<'a, Factor> Lerp<Factor> for &'a BipedSmallSkeleton
where Factor: Copy, Transform<f32, f32, f32>: Lerp<Factor, Output = Transform<f32, f32, f32>>,

Source§

type Output = BipedSmallSkeleton

Source§

fn lerp_unclamped_precise( from: &'a BipedSmallSkeleton, to: &'a BipedSmallSkeleton, factor: Factor, ) -> <&'a BipedSmallSkeleton as Lerp<Factor>>::Output

Source§

fn lerp_unclamped( from: &'a BipedSmallSkeleton, to: &'a BipedSmallSkeleton, factor: Factor, ) -> <&'a BipedSmallSkeleton as Lerp<Factor>>::Output

Source§

impl<'a, Factor> Lerp<Factor> for &'a BirdLargeSkeleton
where Factor: Copy, Transform<f32, f32, f32>: Lerp<Factor, Output = Transform<f32, f32, f32>>,

Source§

type Output = BirdLargeSkeleton

Source§

fn lerp_unclamped_precise( from: &'a BirdLargeSkeleton, to: &'a BirdLargeSkeleton, factor: Factor, ) -> <&'a BirdLargeSkeleton as Lerp<Factor>>::Output

Source§

fn lerp_unclamped( from: &'a BirdLargeSkeleton, to: &'a BirdLargeSkeleton, factor: Factor, ) -> <&'a BirdLargeSkeleton as Lerp<Factor>>::Output

Source§

impl<'a, Factor> Lerp<Factor> for &'a BirdMediumSkeleton
where Factor: Copy, Transform<f32, f32, f32>: Lerp<Factor, Output = Transform<f32, f32, f32>>,

Source§

type Output = BirdMediumSkeleton

Source§

fn lerp_unclamped_precise( from: &'a BirdMediumSkeleton, to: &'a BirdMediumSkeleton, factor: Factor, ) -> <&'a BirdMediumSkeleton as Lerp<Factor>>::Output

Source§

fn lerp_unclamped( from: &'a BirdMediumSkeleton, to: &'a BirdMediumSkeleton, factor: Factor, ) -> <&'a BirdMediumSkeleton as Lerp<Factor>>::Output

Source§

impl<'a, Factor> Lerp<Factor> for &'a CharacterSkeleton
where Factor: Copy, Transform<f32, f32, f32>: Lerp<Factor, Output = Transform<f32, f32, f32>>,

Source§

type Output = CharacterSkeleton

Source§

fn lerp_unclamped_precise( from: &'a CharacterSkeleton, to: &'a CharacterSkeleton, factor: Factor, ) -> <&'a CharacterSkeleton as Lerp<Factor>>::Output

Source§

fn lerp_unclamped( from: &'a CharacterSkeleton, to: &'a CharacterSkeleton, factor: Factor, ) -> <&'a CharacterSkeleton as Lerp<Factor>>::Output

Source§

impl<'a, Factor> Lerp<Factor> for &'a CrustaceanSkeleton
where Factor: Copy, Transform<f32, f32, f32>: Lerp<Factor, Output = Transform<f32, f32, f32>>,

Source§

type Output = CrustaceanSkeleton

Source§

fn lerp_unclamped_precise( from: &'a CrustaceanSkeleton, to: &'a CrustaceanSkeleton, factor: Factor, ) -> <&'a CrustaceanSkeleton as Lerp<Factor>>::Output

Source§

fn lerp_unclamped( from: &'a CrustaceanSkeleton, to: &'a CrustaceanSkeleton, factor: Factor, ) -> <&'a CrustaceanSkeleton as Lerp<Factor>>::Output

Source§

impl<'a, Factor> Lerp<Factor> for &'a DragonSkeleton
where Factor: Copy, Transform<f32, f32, f32>: Lerp<Factor, Output = Transform<f32, f32, f32>>,

Source§

type Output = DragonSkeleton

Source§

fn lerp_unclamped_precise( from: &'a DragonSkeleton, to: &'a DragonSkeleton, factor: Factor, ) -> <&'a DragonSkeleton as Lerp<Factor>>::Output

Source§

fn lerp_unclamped( from: &'a DragonSkeleton, to: &'a DragonSkeleton, factor: Factor, ) -> <&'a DragonSkeleton as Lerp<Factor>>::Output

Source§

impl<'a, Factor> Lerp<Factor> for &'a FishMediumSkeleton
where Factor: Copy, Transform<f32, f32, f32>: Lerp<Factor, Output = Transform<f32, f32, f32>>,

Source§

type Output = FishMediumSkeleton

Source§

fn lerp_unclamped_precise( from: &'a FishMediumSkeleton, to: &'a FishMediumSkeleton, factor: Factor, ) -> <&'a FishMediumSkeleton as Lerp<Factor>>::Output

Source§

fn lerp_unclamped( from: &'a FishMediumSkeleton, to: &'a FishMediumSkeleton, factor: Factor, ) -> <&'a FishMediumSkeleton as Lerp<Factor>>::Output

Source§

impl<'a, Factor> Lerp<Factor> for &'a FishSmallSkeleton
where Factor: Copy, Transform<f32, f32, f32>: Lerp<Factor, Output = Transform<f32, f32, f32>>,

Source§

type Output = FishSmallSkeleton

Source§

fn lerp_unclamped_precise( from: &'a FishSmallSkeleton, to: &'a FishSmallSkeleton, factor: Factor, ) -> <&'a FishSmallSkeleton as Lerp<Factor>>::Output

Source§

fn lerp_unclamped( from: &'a FishSmallSkeleton, to: &'a FishSmallSkeleton, factor: Factor, ) -> <&'a FishSmallSkeleton as Lerp<Factor>>::Output

Source§

impl<'a, Factor> Lerp<Factor> for &'a GolemSkeleton
where Factor: Copy, Transform<f32, f32, f32>: Lerp<Factor, Output = Transform<f32, f32, f32>>,

Source§

type Output = GolemSkeleton

Source§

fn lerp_unclamped_precise( from: &'a GolemSkeleton, to: &'a GolemSkeleton, factor: Factor, ) -> <&'a GolemSkeleton as Lerp<Factor>>::Output

Source§

fn lerp_unclamped( from: &'a GolemSkeleton, to: &'a GolemSkeleton, factor: Factor, ) -> <&'a GolemSkeleton as Lerp<Factor>>::Output

Source§

impl<'a, Factor> Lerp<Factor> for &'a ItemDropSkeleton
where Factor: Copy, Transform<f32, f32, f32>: Lerp<Factor, Output = Transform<f32, f32, f32>>,

Source§

type Output = ItemDropSkeleton

Source§

fn lerp_unclamped_precise( from: &'a ItemDropSkeleton, to: &'a ItemDropSkeleton, factor: Factor, ) -> <&'a ItemDropSkeleton as Lerp<Factor>>::Output

Source§

fn lerp_unclamped( from: &'a ItemDropSkeleton, to: &'a ItemDropSkeleton, factor: Factor, ) -> <&'a ItemDropSkeleton as Lerp<Factor>>::Output

Source§

impl<'a, Factor> Lerp<Factor> for &'a ObjectSkeleton
where Factor: Copy, Transform<f32, f32, f32>: Lerp<Factor, Output = Transform<f32, f32, f32>>,

Source§

type Output = ObjectSkeleton

Source§

fn lerp_unclamped_precise( from: &'a ObjectSkeleton, to: &'a ObjectSkeleton, factor: Factor, ) -> <&'a ObjectSkeleton as Lerp<Factor>>::Output

Source§

fn lerp_unclamped( from: &'a ObjectSkeleton, to: &'a ObjectSkeleton, factor: Factor, ) -> <&'a ObjectSkeleton as Lerp<Factor>>::Output

Source§

impl<'a, Factor> Lerp<Factor> for &'a PluginSkeleton
where Factor: Copy, Transform<f32, f32, f32>: Lerp<Factor, Output = Transform<f32, f32, f32>>,

Source§

type Output = PluginSkeleton

Source§

fn lerp_unclamped_precise( from: &'a PluginSkeleton, to: &'a PluginSkeleton, factor: Factor, ) -> <&'a PluginSkeleton as Lerp<Factor>>::Output

Source§

fn lerp_unclamped( from: &'a PluginSkeleton, to: &'a PluginSkeleton, factor: Factor, ) -> <&'a PluginSkeleton as Lerp<Factor>>::Output

Source§

impl<'a, Factor> Lerp<Factor> for &'a QuadrupedLowSkeleton
where Factor: Copy, Transform<f32, f32, f32>: Lerp<Factor, Output = Transform<f32, f32, f32>>,

Source§

impl<'a, Factor> Lerp<Factor> for &'a QuadrupedMediumSkeleton
where Factor: Copy, Transform<f32, f32, f32>: Lerp<Factor, Output = Transform<f32, f32, f32>>,

Source§

impl<'a, Factor> Lerp<Factor> for &'a QuadrupedSmallSkeleton
where Factor: Copy, Transform<f32, f32, f32>: Lerp<Factor, Output = Transform<f32, f32, f32>>,

Source§

impl<'a, Factor> Lerp<Factor> for &'a ShipSkeleton
where Factor: Copy, Transform<f32, f32, f32>: Lerp<Factor, Output = Transform<f32, f32, f32>>,

Source§

type Output = ShipSkeleton

Source§

fn lerp_unclamped_precise( from: &'a ShipSkeleton, to: &'a ShipSkeleton, factor: Factor, ) -> <&'a ShipSkeleton as Lerp<Factor>>::Output

Source§

fn lerp_unclamped( from: &'a ShipSkeleton, to: &'a ShipSkeleton, factor: Factor, ) -> <&'a ShipSkeleton as Lerp<Factor>>::Output

Source§

impl<'a, Factor> Lerp<Factor> for &'a TheropodSkeleton
where Factor: Copy, Transform<f32, f32, f32>: Lerp<Factor, Output = Transform<f32, f32, f32>>,

Source§

type Output = TheropodSkeleton

Source§

fn lerp_unclamped_precise( from: &'a TheropodSkeleton, to: &'a TheropodSkeleton, factor: Factor, ) -> <&'a TheropodSkeleton as Lerp<Factor>>::Output

Source§

fn lerp_unclamped( from: &'a TheropodSkeleton, to: &'a TheropodSkeleton, factor: Factor, ) -> <&'a TheropodSkeleton as Lerp<Factor>>::Output

Source§

impl<Factor> Lerp<Factor> for &FixtureSkeleton

Source§

type Output = FixtureSkeleton

Source§

fn lerp_unclamped( _from: &FixtureSkeleton, _to: &FixtureSkeleton, _factor: Factor, ) -> <&FixtureSkeleton as Lerp<Factor>>::Output

Source§

fn lerp_unclamped_precise( _from: &FixtureSkeleton, _to: &FixtureSkeleton, _factor: Factor, ) -> <&FixtureSkeleton as Lerp<Factor>>::Output

Implementors§

Source§

impl<'a, P, O, S, Factor> Lerp<Factor> for &'a Transform<P, O, S>
where Factor: Copy + Into<O>, &'a P: Lerp<Factor, Output = P>, &'a S: Lerp<Factor, Output = S>, O: Lerp<O, Output = O> + Real<Output = O> + Add,

LERP on a Transform is defined as LERP-ing between the positions and scales, and performing SLERP between the orientations.

Source§

type Output = Transform<P, O, S>

Source§

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

The Lerp implementation for quaternion is the “Normalized LERP”.

Source§

impl<'a, T, Factor> Lerp<Factor> for &'a Extent2<T>
where &'a T: Lerp<Factor, Output = T>, Factor: Copy,

Source§

impl<'a, T, Factor> Lerp<Factor> for &'a Extent3<T>
where &'a T: Lerp<Factor, Output = T>, Factor: Copy,

Source§

impl<'a, T, Factor> Lerp<Factor> for &'a Rgb<T>
where &'a T: Lerp<Factor, Output = T>, Factor: Copy,

Source§

impl<'a, T, Factor> Lerp<Factor> for &'a Rgba<T>
where &'a T: Lerp<Factor, Output = T>, Factor: Copy,

Source§

impl<'a, T, Factor> Lerp<Factor> for &'a Vec2<T>
where &'a T: Lerp<Factor, Output = T>, Factor: Copy,

Source§

impl<'a, T, Factor> Lerp<Factor> for &'a Vec3<T>
where &'a T: Lerp<Factor, Output = T>, Factor: Copy,

Source§

impl<'a, T, Factor> Lerp<Factor> for &'a Vec4<T>
where &'a T: Lerp<Factor, Output = T>, Factor: Copy,

Source§

impl<P, O, S, Factor> Lerp<Factor> for Transform<P, O, S>
where Factor: Copy + Into<O>, P: Lerp<Factor, Output = P>, S: Lerp<Factor, Output = S>, O: Lerp<O, Output = O> + Real<Output = O> + Add,

LERP on a Transform is defined as LERP-ing between the positions and scales, and performing SLERP between the orientations.

Source§

type Output = Transform<P, O, S>

Source§

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

The Lerp implementation for quaternion is the “Normalized LERP”.

Source§

impl<T, Factor> Lerp<Factor> for Extent2<T>
where T: Lerp<Factor, Output = T>, Factor: Copy,

Source§

impl<T, Factor> Lerp<Factor> for Extent3<T>
where T: Lerp<Factor, Output = T>, Factor: Copy,

Source§

impl<T, Factor> Lerp<Factor> for Rgb<T>
where T: Lerp<Factor, Output = T>, Factor: Copy,

Source§

impl<T, Factor> Lerp<Factor> for Rgba<T>
where T: Lerp<Factor, Output = T>, Factor: Copy,

Source§

impl<T, Factor> Lerp<Factor> for Vec2<T>
where T: Lerp<Factor, Output = T>, Factor: Copy,

Source§

impl<T, Factor> Lerp<Factor> for Vec3<T>
where T: Lerp<Factor, Output = T>, Factor: Copy,

Source§

impl<T, Factor> Lerp<Factor> for Vec4<T>
where T: Lerp<Factor, Output = T>, Factor: Copy,