pub trait Clock {
// Required method
fn delta(&mut self) -> f32;
}Expand description
Abstracts any time source that can produce a dt (delta-time) value in seconds.
Implement this for custom timers, game-engine time sources, or scroll-based drivers.
§Example
use animato_driver::{Clock, MockClock};
let mut clk = MockClock::new(1.0 / 60.0);
assert!((clk.delta() - 1.0 / 60.0).abs() < 1e-6);Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".