Trait bevy::animation::prelude::Animatable
source · pub trait Animatable: Reflect + Sized + Send + Sync + 'static {
// Required methods
fn interpolate(a: &Self, b: &Self, time: f32) -> Self;
fn blend(inputs: impl Iterator<Item = BlendInput<Self>>) -> Self;
// Provided method
fn post_process(&mut self, _world: &World) { ... }
}
Expand description
An animatable value type.
Required Methods§
sourcefn interpolate(a: &Self, b: &Self, time: f32) -> Self
fn interpolate(a: &Self, b: &Self, time: f32) -> Self
Interpolates between a
and b
with a interpolation factor of time
.
The time
parameter here may not be clamped to the range [0.0, 1.0]
.
sourcefn blend(inputs: impl Iterator<Item = BlendInput<Self>>) -> Self
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.
Provided Methods§
sourcefn post_process(&mut self, _world: &World)
fn post_process(&mut self, _world: &World)
Post-processes the value using resources in the World
.
Most animatable types do not need to implement this.
Object Safety§
This trait is not object safe.