diff --git a/src/lib.rs b/src/lib.rs index 0a360d1..7e13e94 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -36,7 +36,12 @@ pub mod core { new_state } - /// Returns the current "delta time", the time elapsed since the last update tick in milliseconds + /// Returns the "update interval", the minimum time (in ms) which will elapse between update ticks + pub fn get_update_interval(self) -> u32 { + self.update_interval + } + + /// Returns the current "delta time", the time (in ms) elapsed since the last update tick pub fn get_delta_time(self) -> u32 { self.delta_time } @@ -71,6 +76,11 @@ pub mod core { self.simulate = true; } + /// Changes the simulation update interval + pub fn set_update_interval(&mut self, update_interval: u32) { + self.update_interval = update_interval; + } + /// Changes the simulation timescale pub fn set_timescale(&mut self, timescale: f32) { self.timescale = timescale;