pub struct Timeline {
pub clips: Vec<AnimClip>,
pub active_clip: usize,
pub playhead: Time,
pub state: PlaybackState,
pub loop_mode: LoopMode,
pub speed: f32,
pub fps: f32,
pub snap_frames: bool,
pub in_point: Time,
pub out_point: Time,
}Expand description
Master timeline — owns all animation clips plus playback state.
Fields§
§clips: Vec<AnimClip>§active_clip: usize§playhead: Time§state: PlaybackState§loop_mode: LoopMode§speed: f32§fps: f32§snap_frames: boolWhether to snap the playhead to frame boundaries.
in_point: TimeIn/out point for looping.
out_point: TimeImplementations§
Source§impl Timeline
impl Timeline
pub fn new() -> Self
pub fn clip(&self) -> &AnimClip
pub fn clip_mut(&mut self) -> &mut AnimClip
pub fn frame_duration(&self) -> Time
pub fn current_frame(&self) -> u32
pub fn total_frames(&self) -> u32
pub fn play(&mut self)
pub fn pause(&mut self)
pub fn stop(&mut self)
pub fn record(&mut self)
pub fn seek(&mut self, t: Time)
pub fn seek_frame(&mut self, frame: i32)
pub fn step_forward(&mut self)
pub fn step_backward(&mut self)
pub fn go_to_start(&mut self)
pub fn go_to_end(&mut self)
Sourcepub fn step(&mut self, dt: f32) -> FrameSnapshot
pub fn step(&mut self, dt: f32) -> FrameSnapshot
Advance by dt seconds of wall-clock time.
Sourcepub fn evaluate(&self, t: Time) -> FrameSnapshot
pub fn evaluate(&self, t: Time) -> FrameSnapshot
Evaluate all tracks at the given time and build a FrameSnapshot.
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 UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.