Skip to main content

Tweenable

Trait Tweenable 

Source
pub trait Tweenable: Copy {
    // Required method
    fn interpolate(from: Self, to: Self, t: f32) -> Self;
}
Expand description

Values that can be interpolated by a tween.

t is eased progress. It is 0.0 and 1.0 at the endpoints but may lie outside [0, 1] for overshooting curves such as Ease::BackOut.

Required Methods§

Source

fn interpolate(from: Self, to: Self, t: f32) -> Self

Interpolates (or extrapolates) from from toward to.

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 [u8; 4]

8-bit RGBA colors (the core’s mesh and manifest color layout). Each channel is interpolated independently, rounded and clamped to 0..=255.

Source§

fn interpolate(from: Self, to: Self, t: f32) -> Self

Source§

impl Tweenable for f32

Source§

fn interpolate(from: Self, to: Self, t: f32) -> Self

Implementors§

Source§

impl Tweenable for Quat

Spherical interpolation for rotations such as doors and hinges.

Source§

impl Tweenable for Vec2

Source§

impl Tweenable for Vec3

Source§

impl Tweenable for Vec4

Also suitable for linear RGBA colors in [0, 1].