pub struct Lagged<T: Clone, E: Eval<Output = T>> {
anims: Vec<E>,
lag_ratio: f64,
_output: PhantomData<fn() -> T>,
}Expand description
The lagged anim.
This is applyable to IntoIterator<Item = T>, and this will apply
the anims in the order of the elements with the lag ratio.
Fields§
§anims: Vec<E>§lag_ratio: f64§_output: PhantomData<fn() -> T>Implementations§
Trait Implementations§
Source§impl<T: Clone, E: Eval<Output = T>> Eval for Lagged<T, E>
impl<T: Clone, E: Eval<Output = T>> Eval for Lagged<T, E>
Source§fn 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).Source§fn 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.
Source§fn 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.
Source§fn 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).Auto Trait Implementations§
impl<T, E> Freeze for Lagged<T, E>
impl<T, E> RefUnwindSafe for Lagged<T, E>where
E: RefUnwindSafe,
impl<T, E> Send for Lagged<T, E>where
E: Send,
impl<T, E> Sync for Lagged<T, E>where
E: Sync,
impl<T, E> Unpin for Lagged<T, E>where
E: Unpin,
impl<T, E> UnsafeUnpin for Lagged<T, E>
impl<T, E> UnwindSafe for Lagged<T, E>where
E: UnwindSafe,
Blanket Implementations§
Source§impl<E> Animation for E
impl<E> Animation for E
Source§fn build(self) -> AnimationCell
fn build(self) -> AnimationCell
Lower this definition into its local runtime representation.
Source§impl<A> AnimationExt for Awhere
A: Placeable,
impl<A> AnimationExt for Awhere
A: Placeable,
Source§fn with_rate_func(self, rate_func: fn(f64) -> f64) -> Paramed<Self>
fn with_rate_func(self, rate_func: fn(f64) -> f64) -> Paramed<Self>
Change the animation’s rate function.
Source§fn with_duration(self, duration_secs: f64) -> Paramed<Self>
fn with_duration(self, duration_secs: f64) -> Paramed<Self>
Change the animation’s duration.
Source§fn with_enabled(self, enabled: bool) -> Paramed<Self>
fn with_enabled(self, enabled: bool) -> Paramed<Self>
Enable or disable this animation’s output.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Converts this type into the system output type.