pub struct Timeline { /* private fields */ }Expand description
Forward playback at 0..=8x, with f64 phase accumulation and saturating loop counts. Pausing, zero speed and zero dt preserve pending start events. Seeking is silent. Resuming never re-emits an already crossed event.
Implementations§
Source§impl Timeline
impl Timeline
pub fn new(duration: f32, mode: LoopMode) -> Result<Timeline, AnimationError>
pub fn time(&self) -> f32
pub fn normalized_time(&self) -> f32
pub fn cycles(&self) -> u64
pub fn speed(&self) -> f32
pub fn paused(&self) -> bool
pub fn finished(&self) -> bool
pub fn set_paused(&mut self, paused: bool)
pub fn set_speed(&mut self, speed: f32) -> Result<(), AnimationError>
pub fn seek(&mut self, time: f32) -> Result<(), AnimationError>
pub fn restart(&mut self)
pub fn advance(&mut self, dt: f32) -> Result<(), AnimationError>
Sourcepub fn advance_events<const N: usize>(
&mut self,
dt: f32,
events: &EventTrack,
out: &mut EventBuffer<N>,
) -> Result<(), AnimationError>
pub fn advance_events<const N: usize>( &mut self, dt: f32, events: &EventTrack, out: &mut EventBuffer<N>, ) -> Result<(), AnimationError>
Clears output on success, emits chronological events in (old,new], plus
initial time-zero events. Repeat seams emit the old cycle’s end before
the new cycle’s start; equal-time keys retain authored order. Work is
O(log(event count) + output capacity), even if millions of loops were
crossed, without allocating. EventBuffer::report describes overflow
and skipped event-bearing cycles. Invalid input leaves clock/queue intact.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Timeline
impl RefUnwindSafe for Timeline
impl Send for Timeline
impl Sync for Timeline
impl Unpin for Timeline
impl UnwindSafe for Timeline
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