Expand description
Core primitives shared by every Crucible crate.
Nothing here depends on a backend, a window, or a renderer — this is the vocabulary layer that the rest of the engine is written in:
handle—Handle, a typed generational id, andPool, the slot arena that issues and invalidates them.world—WorldPos, the sector-tiled absolute position that every simulated thing in the engine uses. PlainVec3is only ever camera-relative render space; seeWorldPos::relative_to.alloc—FrameArena, a fixed-capacity bump allocator for per-frame transient data.time—FrameClock, the fixed-timestep server tick accumulator plus variable render delta,TickId, andEventTime, the stated-epoch timestamp every input event carries.input— the names for keys, buttons and axes (KeyCode,Keysym,PointerButton,Modifiers). Vocabulary only: the event enum lives incrcbl-shell, which is the only crate that produces one.log— stderr logging behind thelogfacade, filtered byCRCBL_LOG, with the console’s log ring inlog::consoleand thelogcommand that sets the filter while the engine runs.player—PlayerId, who a player is across sessions: drawn once by a client, presented in every hello, and self-asserted — see the module docs for how little an open server can trust it.rand— deterministic values from an index, for simulations that replay. Deliberately not a generator; see the module docs for why every sample independently arrived at the same shape.schedule—FixedRateSchedule, per-agent sampling at a fixed rate and a staggered phase, reporting each sample at its exact time inside the tick. Sample times come from an integer index, never an accumulated sum; see the module docs.srgb— the sRGB transfer function,decodeto linear light andencodeback, for colour authored in sRGB.stats—percentile_ofandMIN_PERCENTILE_SAMPLES, the nearest-rank arithmetic the debug panel’s budget row andcrcbl benchboth report through. No mean, on purpose; see the module docs.trace—Spanandcounter, the CPU half of the profiler: scoped spans with static names, nesting freely and carrying the thread they ran on, plus namedu64counters. Compiled into every build and gated at runtime; see the module docs for what that costs.trig—sin,cos,atanandatan2inf64, built from operations IEEE-754 pins down so a simulation that calls them reaches the same bits on every target. No platformlibm; see the module docs.hash— FNV-1a (fnv1a_32,fnv1a_64and theFnv1a64hasher), for ids and digests that must be the same on every target and run.surface—SurfaceTarget, the native window handles the shell produces and a HAL backend consumes. It lives here, and not in either of those crates, because neither may depend on the other; see the module docs for the dependency argument.
Re-exports§
pub use alloc::FrameArena;pub use handle::Handle;pub use handle::Pool;pub use input::KeyCode;pub use player::PlayerId;pub use surface::SurfaceTarget;pub use time::EventTime;pub use time::FrameClock;pub use time::TickId;pub use world::SECTOR_SIZE;pub use world::WorldPos;
Modules§
- alloc
- Frame-scoped bump allocation.
- bounds
- Lane-wise
min/maxthat aNaNcannot corrupt. - handle
- Typed handles and the slot pool that issues them.
- hash
- FNV-1a: a hash whose output is the same on every target, toolchain and run.
- input
- Input vocabulary: the names every layer of the engine uses for keys, buttons, axes and the devices they came from.
- log
- The engine’s logging: five macros, a filter, and the sink they write to.
- logarithm
ln(1 + x)inf64, computed without calling the platform’s logarithm.- player
PlayerId: who a player is, across sessions, on the servers they join.- rand
- Deterministic values from an index, for simulations that have to replay.
- schedule
- Fixed-rate sampling at exact sub-tick times, staggered per agent.
- srgb
- The sRGB transfer function, in both directions, on one channel in
0..=1. - stats
- Nearest-rank percentiles, and the sample count below which one is a lie.
- surface
SurfaceTarget— the one sanctioned platform leak in the engine.- time
- The frame clock: a fixed-timestep accumulator for the server tick plus the variable render delta.
- trace
- CPU spans and counters: where a frame’s time went, and on which thread.
- trig
- Sine, cosine and the arc tangent in
f64, computed without calling the platform’s. - world
- Sector-tiled world positions.
Macros§
- debug
- Logs at
Level::Debug: detail for someone reading this subsystem. - error
- Logs at
Level::Error: something the run could not do. - info
- Logs at
Level::Info: what the run is doing, at the default level. - log_at
- Logs at an explicit
Level, takingformat!arguments. - trace
- Logs at
Level::Trace: every step, for when nothing else has worked. - warn
- Logs at
Level::Warn: something that will surprise someone later.
Functions§
- console_
table - Everything this crate exposes to the debug console.