Add design persistence, world rendering, metrics overlay and logs
Some checks failed
ci / check (macos-latest) (push) Has been cancelled
ci / check (ubuntu-latest) (push) Has been cancelled
ci / check (windows-latest) (push) Has been cancelled

M3: STL/OBJ import with mesh validation, mass/COM/inertia, material database, RON scene with content-addressed blobs and v0->v1 migration. M4: deterministic heightmap terrain, trimesh colliders, wgpu renderer with instancing and depth, winit app with 1 kHz physics, fly camera, on-screen metrics overlay and per-frame CSV/dev logs. Docs: UI, logging, network and headless CLI plans.
This commit is contained in:
Loki 2026-11-16 23:34:05 +01:00
parent 79928b645b
commit 93075ab1fd
Signed by: boba
GPG key ID: 6CDE87BC9A778D97
107 changed files with 14785 additions and 46 deletions

View file

@ -0,0 +1,35 @@
//! A fixed-length FIFO that models the transport delay of a sensor bus.
use std::collections::VecDeque;
/// A FIFO of `steps` samples.
///
/// The queue starts filled with `initial`, so the first `steps` calls to
/// [`Delay::push`] report that value while the queue drains.
#[derive(Debug, Clone, PartialEq)]
pub struct Delay<T> {
initial: T,
queue: VecDeque<T>,
}
impl<T: Clone> Delay<T> {
/// A delay of `steps` samples, reporting `initial` until the queue fills.
pub fn new(steps: usize, initial: T) -> Self {
Self {
initial: initial.clone(),
queue: core::iter::repeat_n(initial, steps).collect(),
}
}
/// Pushes a new sample and returns the one measured `steps` samples ago, or the
/// new sample itself when the delay is zero.
pub fn push(&mut self, value: T) -> T {
if self.queue.is_empty() {
return value;
}
self.queue.push_back(value);
self.queue
.pop_front()
.unwrap_or_else(|| self.initial.clone())
}
}