pub struct FixedTimestep {
pub step: f64,
pub tick_count: u64,
/* private fields */
}Expand description
Fixed-timestep configuration stored as a resource.
The game loop ticks the schedule at a fixed rate (default 10 Hz for RTS). A time accumulator ensures deterministic simulation: the same inputs produce the same outputs regardless of frame rate.
Fields§
§step: f64Seconds per tick (1.0 / tick_rate).
tick_count: u64Total number of ticks executed.
Implementations§
Source§impl FixedTimestep
impl FixedTimestep
Sourcepub const MIN_HZ: f64 = 1.0
pub const MIN_HZ: f64 = 1.0
Minimum tick rate (1 Hz). Below this, use event-driven scheduling instead.
Sourcepub const MAX_HZ: f64 = 240.0
pub const MAX_HZ: f64 = 240.0
Maximum tick rate (240 Hz). Beyond this, the per-tick budget is too small for meaningful simulation work and risks death-spiraling the game loop.
Sourcepub fn default_rts() -> Self
pub fn default_rts() -> Self
Create a 10 Hz timestep (default for RTS).
Auto Trait Implementations§
impl Freeze for FixedTimestep
impl RefUnwindSafe for FixedTimestep
impl Send for FixedTimestep
impl Sync for FixedTimestep
impl Unpin for FixedTimestep
impl UnsafeUnpin for FixedTimestep
impl UnwindSafe for FixedTimestep
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