Thanks to visit codestin.com
Credit goes to docs.rs

Skip to main content

Tweenable

Trait Tweenable 

Source
pub trait Tweenable: Copy {
    // Required method
    fn interpolate(a: Self, b: Self, amount: f64) -> Self;
}
Expand description

A trait for types that can be smoothly interpolated.

Required Methods§

Source

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".

Implementations on Foreign Types§

Source§

impl Tweenable for f32

Source§

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

Source§

impl Tweenable for f64

Source§

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

Source§

impl Tweenable for Duration

Source§

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

Source§

impl Tweenable for Quat

Source§

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

Source§

impl Tweenable for Vec3

Source§

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

Implementors§