Animatable

Trait Animatable 

Source
pub trait Animatable:
    Sized
    + Reflect
    + Send
    + Sync
    + 'static {
    // Required methods
    fn interpolate(a: &Self, b: &Self, time: f32) -> Self;
    fn blend(inputs: impl Iterator<Item = BlendInput<Self>>) -> Self;
}
Expand description

An animatable value type.

Required Methods§

Source

fn interpolate(a: &Self, b: &Self, time: f32) -> Self

Interpolates between a and b with an interpolation factor of time.

The time parameter here may not be clamped to the range [0.0, 1.0].

Source

fn blend(inputs: impl Iterator<Item = BlendInput<Self>>) -> Self

Blends one or more values together.

Implementors should return a default value when no inputs are provided here.

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 Animatable for bool

Source§

fn interpolate(a: &bool, b: &bool, t: f32) -> bool

Source§

fn blend(inputs: impl Iterator<Item = BlendInput<bool>>) -> bool

Source§

impl Animatable for f32

Source§

fn interpolate(a: &f32, b: &f32, t: f32) -> f32

Source§

fn blend(inputs: impl Iterator<Item = BlendInput<f32>>) -> f32

Source§

impl Animatable for f64

Source§

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

Source§

fn blend(inputs: impl Iterator<Item = BlendInput<f64>>) -> f64

Source§

impl Animatable for DVec2

Source§

fn interpolate(a: &DVec2, b: &DVec2, t: f32) -> DVec2

Source§

fn blend(inputs: impl Iterator<Item = BlendInput<DVec2>>) -> DVec2

Source§

impl Animatable for DVec3

Source§

fn interpolate(a: &DVec3, b: &DVec3, t: f32) -> DVec3

Source§

fn blend(inputs: impl Iterator<Item = BlendInput<DVec3>>) -> DVec3

Source§

impl Animatable for DVec4

Source§

fn interpolate(a: &DVec4, b: &DVec4, t: f32) -> DVec4

Source§

fn blend(inputs: impl Iterator<Item = BlendInput<DVec4>>) -> DVec4

Implementors§