pub struct ManualClock { /* private fields */ }Expand description
A clock where the caller explicitly sets the dt each frame.
Call advance to set the pending dt,
then delta to consume it (resets to 0.0).
Useful for custom game loops that already compute their own dt.
§Example
use animato_driver::{Clock, ManualClock};
let mut clk = ManualClock::new();
clk.advance(0.016);
assert!((clk.delta() - 0.016).abs() < 1e-6);
assert_eq!(clk.delta(), 0.0); // consumedImplementations§
Trait Implementations§
Source§impl Clock for ManualClock
impl Clock for ManualClock
Source§impl Debug for ManualClock
impl Debug for ManualClock
Source§impl Default for ManualClock
impl Default for ManualClock
Source§fn default() -> ManualClock
fn default() -> ManualClock
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ManualClock
impl RefUnwindSafe for ManualClock
impl Send for ManualClock
impl Sync for ManualClock
impl Unpin for ManualClock
impl UnsafeUnpin for ManualClock
impl UnwindSafe for ManualClock
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