Skip to main content

concinnity_core/physics/
mod.rs

1//! The rigid-body simulation driver: it builds a simulation from the world's
2//! physics content at init, steps it on the fixed tick, and writes the results
3//! back as component data.
4//!
5//! The simulation itself is [`concinnity_physics::Simulation`], whose
6//! vocabulary is `[f32; 3]` / Euler-degree data addressed by an opaque
7//! `BodyHandle`. This module holds the driver around it: prop bodies, character
8//! rigs, probes, contact shaping, and layer resolution.
9//!
10//! Nothing here reads a clock, a file, or a device. The one thing only a host
11//! can supply is threads, which it lends through [`PhysicsFanout`]; a world
12//! with none steps on the calling thread.
13
14// What the simulation reserves for a world, and the ledger row reporting it.
15mod budget;
16// Contact-event shaping: per-frame batching and the per-pair refractory.
17mod contacts;
18// The authored assets turned into the simulation's shapes and parameters.
19mod convert;
20// The seam a host lends the step's independent work its threads through.
21mod fanout;
22// The sorted lookup containers the driver's indices are kept in.
23mod index;
24// Prev/curr pose snapshots blended by the frame's accumulator alpha.
25mod interp;
26// Named collision layers over the simulation's 32-bit interaction groups.
27mod layers;
28// Raycast probe answering for animation IK and the follow camera.
29mod probes;
30// Prop bodies with their handle -> entity and tracked-entity indices.
31mod props;
32// Root-motion character rigs: one kinematic capsule per `CharacterRig`.
33mod rig;
34// The system that builds and steps the simulation from the world's bodies,
35// driven by an optional `PhysicsConfig`.
36mod system;
37// The world's floor: the heightfield collider and the noise it is sampled from.
38mod terrain;
39
40#[cfg(test)]
41mod test_world;
42
43pub use fanout::{PhysicsFanout, SerialFanout};
44pub use system::PhysicsSystem;