Struct MultiRateSimClock
pub struct MultiRateSimClock {
pub physics_accumulator: FixedTimestepAccumulator,
pub lockstep_substep_ratio: u32,
pub substeps_since_lockstep: u32,
pub total_lockstep_ticks: u64,
}Expand description
Multi-rate simulation clock coordinating 64 Hz continuous physics substeps with deterministic lockstep world-state ticks.
Fields§
§physics_accumulator: FixedTimestepAccumulator64 Hz fixed timestep accumulator for high-rate continuous physics and character stepping.
lockstep_substep_ratio: u32Number of physics substeps required to trigger one lockstep tick (typically 3 for ~21.3 Hz ≈ 20 Hz).
substeps_since_lockstep: u32Accumulated physics substeps since the last lockstep tick.
total_lockstep_ticks: u64Total deterministic lockstep ticks executed.
Implementations§
§impl MultiRateSimClock
impl MultiRateSimClock
pub const fn new(lockstep_substep_ratio: u32) -> MultiRateSimClock
pub const fn new(lockstep_substep_ratio: u32) -> MultiRateSimClock
Creates a new MultiRateSimClock with the given substep-to-tick ratio.
pub fn advance(&mut self, raw_delta_seconds: f64) -> (usize, usize)
pub fn advance(&mut self, raw_delta_seconds: f64) -> (usize, usize)
Advances the clock by real frame delta time in seconds.
Returns (physics_substeps, lockstep_ticks) to execute during this frame.
pub fn interpolation_alpha(&self) -> f32
pub fn interpolation_alpha(&self) -> f32
Returns fractional blend factor $\alpha \in [0, 1)$ between the previous and current physics states for renderer interpolation.
pub fn reset(&mut self)
pub fn reset(&mut self)
Resets all counters and accumulator.
Trait Implementations§
§impl Clone for MultiRateSimClock
impl Clone for MultiRateSimClock
§fn clone(&self) -> MultiRateSimClock
fn clone(&self) -> MultiRateSimClock
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more