pub trait Interpolate: Clone {
// Required method
fn interpolate(&self, other: &Self, t: f32) -> Self;
}Expand description
Trait for types that can be interpolated between two values
§Example
use armas_basic::animation::Interpolate;
let a = 0.0_f32;
let b = 10.0_f32;
assert_eq!(a.interpolate(&b, 0.5), 5.0);Required Methods§
Sourcefn interpolate(&self, other: &Self, t: f32) -> Self
fn interpolate(&self, other: &Self, t: f32) -> Self
Interpolate between self and other by factor t (0.0 to 1.0)
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.