pub trait Animatable<T> {
// Required method
fn transform(&self, app: &App, t: f64) -> T;
// Provided methods
fn evaluate(&self, app: &App, animation: AnyAnimation<f64>) -> T
where Self: Sized { ... }
fn animate(
self,
app: &mut App,
parent: Retained<AnyAnimation<f64>>,
) -> Retained<AnyAnimation<T>>
where Self: Sized + Clone + 'static,
T: 'static { ... }
fn chain<P>(self, parent: P) -> ChainedEvaluation<P, Self>
where Self: Sized + Clone,
P: Animatable<f64> + Clone { ... }
}Expand description
An object that can produce a value of type T given an Animation<double>
as input.
Typically, the values of the input animation are nominally in the range 0.0 to 1.0. In principle, however, any value could be provided.
The main implementor of Animatable is Tween.
Required Methods§
Provided Methods§
Sourcefn animate(
self,
app: &mut App,
parent: Retained<AnyAnimation<f64>>,
) -> Retained<AnyAnimation<T>>
fn animate( self, app: &mut App, parent: Retained<AnyAnimation<f64>>, ) -> Retained<AnyAnimation<T>>
Returns a new animation that is driven by the given animation but
that takes on values determined by this object. The new animation keeps
parent; whoever keeps the result keeps both.
Sourcefn chain<P>(self, parent: P) -> ChainedEvaluation<P, Self>
fn chain<P>(self, parent: P) -> ChainedEvaluation<P, Self>
Returns a new Animatable whose value is determined by first
evaluating the given parent and then evaluating this object at the
result.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".