Skip to main content

Crate symtropy_physics

Crate symtropy_physics 

Source
Expand description

N-dimensional rigid body physics engine.

Provides dimension-agnostic rigid body dynamics, GJK collision detection, and constraint solving. All types are const D: usize parameterized for stack-allocated, SIMD-friendly physics at 2D/3D/4D.

§Architecture

  • RigidBody<D> — position, velocity, angular velocity (bivector), mass, collider
  • PhysicsWorld<D> — owns bodies, steps simulation, resolves collisions
  • gjk::intersects() — GJK intersection test for any Shape<D>
  • contact::ContactManifold<D> — collision contact data
  • integrator — semi-implicit Euler with bivector angular dynamics

Re-exports§

pub use articulation::ArticulatedChain;
pub use articulation::ChainBuilder;
pub use articulation::LinkSpec;
pub use body::BodyHandle;
pub use body::BodyType;
pub use body::NetId;
pub use body::RigidBody;
pub use broadphase::morton_encode;
pub use broadphase::morton_prefix;
pub use broadphase::Aabb;
pub use broadphase::Lbvh;
pub use constraint::Constraint;
pub use contact::CollisionEvent;
pub use contact::ContactCache;
pub use contact::ContactManifold;
pub use contact::SensorEvent;
pub use epa::EpaResult;
pub use joints::BallJoint;
pub use joints::FixedJoint;
pub use joints::HingeJoint;
pub use joints::MotorDrive;
pub use joints::PrismaticJoint;
pub use replay::apply_commands;
pub use replay::ReplayTape;
pub use replay::WorldCommand;
pub use replay::WorldSnapshot;
pub use world::NoOpCallback;
pub use world::PhysicsCallback;
pub use world::PhysicsWorld;

Modules§

articulation
Articulated chain builder for serial kinematic chains.
body
broadphase
Broadphase collision detection via LBVH (Linear Bounding Volume Hierarchy).
ccd
Continuous Collision Detection (CCD): prevents fast-moving bodies from tunneling through surfaces between frames.
constraint
Constraint trait for ND joints and connections.
contact
epa
EPA (Expanding Polytope Algorithm) for penetration depth and contact normal.
gjk
GJK (Gilbert–Johnson–Keerthi) intersection test generalized to N dimensions.
integrator
Semi-implicit Euler integrator for ND rigid body dynamics.
island
Island detection: groups connected bodies into independent clusters.
joints
Joint types for articulated bodies.
manifold_gen
Multi-point contact manifold generation via contact clustering.
raycast
Ray casting: find the first intersection of a ray with physics bodies.
replay
Determinism helpers: record/replay command streams and bitwise snapshots.
world
Physics world: owns bodies, steps simulation, resolves collisions.