devela::_dep::kira

Trait Tweenable

pub trait Tweenable: Copy {
    // Required method
    fn interpolate(a: Self, b: Self, amount: f64) -> Self;
}
Available on crate feature dep_kira only.
Expand description

A trait for types that can be smoothly interpolated.

Required Methods§

fn interpolate(a: Self, b: Self, amount: f64) -> Self

Returns an linearly interpolated value between a and b.

An amount of 0.0 should yield a, an amount of 1.0 should yield b, and an amount of 0.5 should yield a value halfway between a and b.

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§

§

impl Tweenable for f32

§

fn interpolate(a: f32, b: f32, amount: f64) -> f32

§

impl Tweenable for f64

§

fn interpolate(a: f64, b: f64, amount: f64) -> f64

§

impl Tweenable for Quat

§

fn interpolate(a: Quat, b: Quat, amount: f64) -> Quat

§

impl Tweenable for Vec3

§

fn interpolate(a: Vec3, b: Vec3, amount: f64) -> Vec3

Implementors§