pub struct Animator {
pub clip: AnimationId,
pub t: f32,
pub speed: f32,
pub layers: Vec<Layer>,
/* private fields */
}Expand description
Single-track playback with crossfades plus a stack of override layers.
step is the fixed-timestep door (the physics doctrine): drive it with a
constant dt for replayable results. Switching to the same clip is a
deliberate no-op — restarts belong to the caller (sequencer).
Fields§
§clip: AnimationId§t: f32Base playhead; step advances it by speed * dt.
speed: f32§layers: Vec<Layer>Override layers, applied bottom to top.
Implementations§
Source§impl Animator
impl Animator
pub fn new(clip: AnimationId) -> Self
pub fn fading(&self) -> bool
Sourcepub fn play(&mut self, clip: AnimationId, fade: f32)
pub fn play(&mut self, clip: AnimationId, fade: f32)
Switch clips. fade > 0 crossfades from the current pose over
fade seconds (the new clip starts at t = 0); fade = 0 cuts.
If the old or new clip is missing from the library the fade is
skipped — a plain cut still lands on the new id.
Trait Implementations§
impl StructuralPartialEq for Animator
Auto Trait Implementations§
impl Freeze for Animator
impl RefUnwindSafe for Animator
impl Send for Animator
impl Sync for Animator
impl Unpin for Animator
impl UnsafeUnpin for Animator
impl UnwindSafe for Animator
Blanket Implementations§
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