Added getter + setter for update interval

This commit is contained in:
skyeshroom 2021-08-12 13:43:39 -07:00
parent e71f603aeb
commit 915d17da80

View File

@ -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;