euv_core/game/clock/struct.rs
1use super::*;
2
3/// Fixed-timestep accumulator and variable-rate frame telemetry clock for real-time game loops.
4#[derive(Clone, Copy, Data, Debug, New, PartialEq)]
5pub struct FrameClock {
6 /// Fixed simulation step duration in seconds (default `1.0 / 60.0`).
7 #[get(type(copy))]
8 pub(crate) fixed_dt: f32,
9 /// Upper cap on fixed substeps executed per rendered frame to prevent spiral-of-death stalls.
10 #[get(type(copy))]
11 pub(crate) max_substeps: u32,
12 /// Remaining accumulated simulation time in seconds.
13 #[new(skip)]
14 #[get(type(copy))]
15 pub(crate) accumulator: f32,
16 /// Clamped variable delta time of the most recent frame in seconds.
17 #[new(skip)]
18 #[get(type(copy))]
19 pub(crate) delta_secs: f32,
20 /// Total elapsed wall/simulation time in seconds.
21 #[new(skip)]
22 #[get(type(copy))]
23 pub(crate) elapsed_secs: f64,
24 /// Interpolation alpha in `[0.0, 1.0]` between the previous and next fixed simulation states.
25 #[new(skip)]
26 #[get(type(copy))]
27 pub(crate) alpha: f32,
28 /// Smoothed frames-per-second measurement.
29 #[new(skip)]
30 #[get(type(copy))]
31 pub(crate) fps: f32,
32 /// Total rendered frames elapsed.
33 #[new(skip)]
34 #[get(type(copy))]
35 pub(crate) frame_count: u64,
36 /// Total fixed simulation steps executed.
37 #[new(skip)]
38 #[get(type(copy))]
39 pub(crate) fixed_step_count: u64,
40}