concinnity_physics/lib.rs
1//! Concinnity physics: the engine's rigid-body simulation and the vocabulary
2//! it is driven through, in its own crate so it names no engine domain type.
3//! It provides the shapes, body parameters, joints, layer masks, and step
4//! results that cross the boundary between a caller and the [`Simulation`],
5//! and the [`PhysicsBudget`] a world reserves its bodies against.
6//!
7//! Everything crossing that boundary is plain data in the engine's `[f32; 3]`
8//! and Euler-degree representation, addressed by an opaque [`BodyHandle`].
9//! That is what lets the simulation hold whatever math types it likes without
10//! those types reaching a caller.
11
12#![no_std]
13
14extern crate alloc;
15
16// The test harness is a std program.
17#[cfg(test)]
18extern crate std;
19
20#[cfg(test)]
21mod bench;
22mod budget;
23mod character;
24mod events;
25mod fanout;
26mod handle;
27mod joints;
28mod layers;
29mod sim;
30#[cfg(test)]
31mod tests;
32mod types;
33
34pub use budget::{PhysicsBudget, PhysicsCounts};
35pub use character::{CharacterMove, CharacterMoveInput};
36pub use events::{ContactHit, RayHit, SensorCrossing};
37pub use fanout::{Fanout, Inline};
38pub use handle::BodyHandle;
39pub use joints::{JointMotor, JointSpec};
40pub use layers::LayerMask;
41pub use sim::{
42 CharacterCapsule, ShapeCast, ShapeCastHit, SimConfig, Simulation, euler_deg_from_quat,
43 quat_from_euler_deg,
44};
45pub use types::{ColliderShape, DynamicParams};
46
47/// Acceleration due to gravity in world units per second squared. Shared with
48/// the third-person controller so its jump takeoff matches the rig's fall.
49pub const GRAVITY: f32 = 20.0;