Skip to main content

symtropy_physics/
lib.rs

1// Copyright (C) 2024-2026 Tristan Stoltz / Luminous Dynamics
2// SPDX-License-Identifier: AGPL-3.0-or-later
3// Commercial licensing: see COMMERCIAL_LICENSE.md at repository root
4//! N-dimensional rigid body physics engine.
5//!
6//! Provides dimension-agnostic rigid body dynamics, GJK collision detection,
7//! and constraint solving. All types are `const D: usize` parameterized for
8//! stack-allocated, SIMD-friendly physics at 2D/3D/4D.
9//!
10//! # Architecture
11//! - `RigidBody<D>` — position, velocity, angular velocity (bivector), mass, collider
12//! - `PhysicsWorld<D>` — owns bodies, steps simulation, resolves collisions
13//! - `gjk::intersects()` — GJK intersection test for any `Shape<D>`
14//! - `contact::ContactManifold<D>` — collision contact data
15//! - `integrator` — semi-implicit Euler with bivector angular dynamics
16
17pub mod body;
18pub mod broadphase;
19pub mod ccd;
20pub mod contact;
21pub mod constraint;
22pub mod epa;
23pub mod gjk;
24pub mod integrator;
25pub mod joints;
26pub mod raycast;
27pub mod replay;
28pub mod world;
29
30pub use body::{BodyHandle, BodyType, NetId, RigidBody};
31pub use contact::{CollisionEvent, ContactCache, ContactManifold, SensorEvent};
32pub use constraint::Constraint;
33pub use epa::EpaResult;
34pub use broadphase::{Aabb, Lbvh, morton_encode, morton_prefix};
35pub use joints::{BallJoint, FixedJoint, HingeJoint};
36pub use replay::{apply_commands, ReplayTape, WorldCommand, WorldSnapshot};
37pub use world::{NoOpCallback, PhysicsCallback, PhysicsWorld};