pub trait Eval {
type Output;
// Provided methods
fn eval_alpha(&self, _alpha: f64) -> Self::Output { ... }
fn sample(&self, time: &SegmentTime) -> Self::Output { ... }
fn reset(&mut self) { ... }
fn step(&mut self, _time: &SegmentTime) { ... }
fn apply_to(self, item: &mut Self::Output) -> Self
where Self: Sized { ... }
fn apply_alpha_to(self, item: &mut Self::Output, alpha: f64) -> Self
where Self: Sized { ... }
}Expand description
A normalized animation evaluator.
Functional (closed-form) segments implement Eval::eval_alpha; the other
methods default appropriately. Iterative (stateful) segments implement
Eval::sample/Eval::reset/Eval::step instead — eval_alpha has
no closed form and its default panics if called.
Required Associated Types§
Provided Methods§
Sourcefn eval_alpha(&self, _alpha: f64) -> Self::Output
fn eval_alpha(&self, _alpha: f64) -> Self::Output
Evaluate the animation at a normalized progress in [0, 1].
Functional segments implement this; iterative segments have no closed
form and the default panics (the runtime drives them via sample).
Sourcefn sample(&self, time: &SegmentTime) -> Self::Output
fn sample(&self, time: &SegmentTime) -> Self::Output
Sample the current state at the given time context. Functional default = eval_alpha(time.alpha); iterative segments implement this to return their current state.
Sourcefn reset(&mut self)
fn reset(&mut self)
Reset to the segment’s initial state (deterministic contract: no wall clock, no unseeded RNG). No-op by default.
Sourcefn step(&mut self, _time: &SegmentTime)
fn step(&mut self, _time: &SegmentTime)
Advance one logic step (or substep); time.local_delta_secs is the
integration step. No-op by default (functional segments are stepped as
no-ops for free; sampling is unaffected).
Sourcefn apply_to(self, item: &mut Self::Output) -> Selfwhere
Self: Sized,
fn apply_to(self, item: &mut Self::Output) -> Selfwhere
Self: Sized,
Apply the final state and return this evaluator.
Sourcefn apply_alpha_to(self, item: &mut Self::Output, alpha: f64) -> Selfwhere
Self: Sized,
fn apply_alpha_to(self, item: &mut Self::Output, alpha: f64) -> Selfwhere
Self: Sized,
Apply a sampled state and return this evaluator.