euv-core 0.47.1

Core cross-platform runtime for euv featuring arena-based fine-grained reactivity, deterministic layout, flat scene graph, multi-mode rendering, and direct OS platform adapters.
Documentation
use super::*;

/// Integer-nanosecond fixed-timestep accumulator with VSync-boundary hysteresis and dt-invariant FPS telemetry.
#[derive(Clone, Copy, Data, Debug, PartialEq)]
pub struct FrameClock {
    /// Fixed simulation step duration in seconds (synchronized with `fixed_step_ns`).
    #[get(type(copy))]
    pub(crate) fixed_dt: f32,
    /// Authoritative fixed simulation step duration in integer nanoseconds (`16_666_667` for 60Hz).
    #[get(type(copy))]
    pub(crate) fixed_step_ns: u64,
    /// Upper cap on fixed substeps executed per rendered frame to prevent spiral-of-death stalls.
    #[get(type(copy))]
    pub(crate) max_substeps: u32,
    /// Remaining accumulated simulation time in integer nanoseconds.
    #[get(type(copy))]
    pub(crate) accumulator_ns: u64,
    /// Remaining accumulated simulation time in seconds (derived from `accumulator_ns`).
    #[get(type(copy))]
    pub(crate) accumulator: f32,
    /// Clamped variable delta time of the most recent frame in integer nanoseconds.
    #[get(type(copy))]
    pub(crate) delta_ns: u64,
    /// Clamped variable delta time of the most recent frame in seconds.
    #[get(type(copy))]
    pub(crate) delta_secs: f32,
    /// Total elapsed wall/simulation time in integer nanoseconds.
    #[get(type(copy))]
    pub(crate) elapsed_ns: u64,
    /// Total elapsed wall/simulation time in seconds.
    #[get(type(copy))]
    pub(crate) elapsed_secs: f64,
    /// Interpolation alpha in `[0.0, 1.0]` between the previous and next fixed simulation states.
    #[get(type(copy))]
    pub(crate) alpha: f32,
    /// Time-constant-invariant exponentially smoothed frames-per-second measurement.
    #[get(type(copy))]
    pub(crate) fps: f32,
    /// Total rendered frames elapsed.
    #[get(type(copy))]
    pub(crate) frame_count: u64,
    /// Total fixed simulation steps executed.
    #[get(type(copy))]
    pub(crate) fixed_step_count: u64,
}