Skip to main content

Interpolate

Trait Interpolate 

Source
pub trait Interpolate: Copy {
    // Required methods
    fn interpolate(self, end: Self, amount: f32) -> Self;
    fn is_valid_interpolation_value(self) -> bool;
}
Expand description

Value type that can be interpolated by Tween.

Implementations should avoid producing NaN for normal finite inputs. amount is already eased by the caller and is usually in 0.0..=1.0, but overshoot curves may pass values above 1.0.

Required Methods§

Source

fn interpolate(self, end: Self, amount: f32) -> Self

Interpolates between self and end.

Source

fn is_valid_interpolation_value(self) -> bool

Returns whether this value may be stored by a Tween.

Implementations must reject any invalid representation that interpolation could otherwise propagate into renderer or camera state.

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

Source§

fn interpolate(self, end: Self, amount: f32) -> Self

Source§

fn is_valid_interpolation_value(self) -> bool

Implementors§