Expand description
§OxiPhysics — Unified Physics Engine
OxiPhysics is a pure-Rust, modular physics engine that re-exports all sub-crates for convenient, single-dependency access. It targets the same problem domains as Bullet, OpenFOAM, LAMMPS, and CalculiX.
§Quick Start
use oxiphysics::core::math::Vec3;
use oxiphysics::core::Transform;
let t = Transform::default();
let v = Vec3::new(1.0, 2.0, 3.0);
let _transformed = t.transform_point(&v);§Module Overview
| Module | Description |
|---|---|
core | Math types, traits, ODE solvers, stochastic processes |
geometry | Shape primitives and mesh utilities |
collision | Broad-phase and narrow-phase collision detection |
rigid | Rigid body dynamics |
articulated | Featherstone articulated-body dynamics (RNEA + ABA) |
constraints | Constraint / joint solvers |
vehicle | Vehicle dynamics simulation |
sph | Smoothed-particle hydrodynamics |
lbm | Lattice Boltzmann method |
fem | Finite element method |
md | Molecular dynamics |
softbody | Soft body / cloth simulation |
materials | Material property database |
gpu | GPU acceleration backends |
viz | Visualization helpers |
io | File I/O and serialization |
pipeline | Full simulation pipeline |
force_field | Spatial force fields (gravity wells, vortex, explosion) |
event_bus | Physics event publish/subscribe system |
replay | Deterministic simulation replay (record → replay) |
query | Spatial queries — raycasting, sphere sweeps, overlaps |
scene | Declarative scene description with JSON round-trip |
snapshot | World-state snapshots with delta tracking |
trigger | Trigger/sensor volumes — enter/exit/stay events |
animation | Keyframe animation tracks (Vec3 + quaternion SLERP) |
material_table | Runtime material interaction table with combine rules |
debug_draw | Renderer-agnostic debug draw command buffer |
contact_cache | Persistent contact pair cache with warm-start impulses |
buoyancy | Archimedes buoyancy and drag forces for fluid volumes |
scheduler | Priority-based physics step budget allocation per island |
spatial_grid | Uniform spatial hash grid for fast neighbourhood queries |
lod | Level-of-Detail simulation tier management |
noise | Procedural 3D value noise and fractal Brownian motion |
interpolator | Smooth damp, exp decay, spring followers, lerp utilities |
telemetry | Per-step physics stats, rolling averages, CSV export |
character | Kinematic capsule character controller with sweep-and-slide, step-up, and slope handling |
rope | Rope / chain distance constraints with Verlet integration and Gauss-Seidel projection |
xpbd | Extended Position-Based Dynamics integrator with compliance and Lagrange multipliers |
ik | Inverse kinematics — FABRIK and 2-bone analytic IK with joint cone limits |
profiler | Hierarchical scoped profiler with RAII guards, frame reports, and flamegraph export |
aero | Aerodynamics — velocity-squared drag and airfoil lift/drag forces |
navmesh | Navigation mesh with A* pathfinding and funnel-algorithm path smoothing |
rollback | Snapshot-based rollback and deterministic lockstep input buffer |
§Stability Policy
Every public API is annotated with a stability level. See
core::stability for details and the core::stability::HasStability
trait for programmatic queries. Stable APIs follow semver; unstable and
experimental APIs may change across minor releases.
Re-exports§
pub use oxiphysics_core as core;pub use oxiphysics_geometry as geometry;pub use oxiphysics_collision as collision;pub use oxiphysics_rigid as rigid;pub use oxiphysics_articulated as articulated;pub use oxiphysics_constraints as constraints;pub use oxiphysics_vehicle as vehicle;pub use oxiphysics_sph as sph;pub use oxiphysics_lbm as lbm;pub use oxiphysics_fem as fem;pub use oxiphysics_md as md;pub use oxiphysics_softbody as softbody;pub use oxiphysics_materials as materials;pub use oxiphysics_gpu as gpu;pub use oxiphysics_viz as viz;pub use oxiphysics_io as io;pub use oxiphysics_wasm as wasm;
Modules§
- aero
- Aerodynamics — velocity-squared drag and airfoil lift/drag forces. Aerodynamics — velocity-squared drag and airfoil lift/drag forces.
- animation
- Keyframe animation tracks (Vec3 lerp + quaternion SLERP) for scripted motion. Keyframe animation tracks for scripted body motion.
- buoyancy
- Archimedes buoyancy and viscous drag for bodies in fluid volumes. Archimedes buoyancy and viscous drag for bodies immersed in fluid volumes.
- character
- Kinematic capsule character controller with sweep-and-slide, step-up, and slope handling. Kinematic capsule character controller with sweep-and-slide, step-up, and slope handling.
- contact_
cache - Persistent contact pair cache with warm-start impulse data. Persistent contact pair cache with warm-starting support.
- coupling
- Cross-domain auto-coupling runtime (OxiCAR — Blueprint KF-1).
- debug_
draw - Renderer-agnostic debug draw command buffer for visualising physics state. Renderer-agnostic debug draw command buffer.
- event_
bus - Physics event publish/subscribe system. Physics event publish/subscribe system.
- force_
field - Spatial force fields (gravity wells, vortex, wind, explosion). Spatial force-field system for applying continuous forces to rigid bodies.
- ik
- Inverse kinematics — FABRIK and 2-bone analytic IK with joint cone limits. Inverse kinematics — FABRIK and 2-bone analytic IK with joint cone limits.
- interpolator
- Motion interpolation — smooth damp, exponential decay, spring followers. Motion interpolation — smooth damp, exponential decay, spring followers, and scalar / vector utility functions.
- lod
- Level-of-Detail simulation tier management. Level-of-Detail (LOD) simulation tier management.
- material_
table - Runtime material interaction table with combine rules and per-pair overrides. Runtime material interaction table.
- navmesh
- Navigation mesh with A* pathfinding and funnel-algorithm path smoothing. Navigation mesh with A* pathfinding and funnel-algorithm path smoothing.
- noise
- Procedural 3D value noise and fractal Brownian motion (fBm). Procedural 3D noise for turbulence, terrain, and force variation.
- perf_
regression - Performance regression testing infrastructure. Performance regression testing infrastructure.
- pipeline
- Full physics simulation pipeline. Full physics simulation pipeline.
- profiler
- Hierarchical scoped profiler with RAII guards, frame reports, and flamegraph export. Hierarchical scoped profiler with RAII guards, frame reports, and flamegraph export.
- query
- Spatial query API — ray casting, sphere sweeps, and overlap tests. Spatial query API — ray casting, sphere sweeps, and overlap tests.
- replay
- Deterministic simulation replay (record → serialise → replay). Deterministic simulation replay: record all external inputs and replay them.
- rollback
- Snapshot-based rollback and deterministic lockstep input buffer. Snapshot-based rollback and deterministic lockstep input buffer.
- rope
- Rope / chain distance constraints with Verlet integration and Gauss-Seidel projection. Rope / chain distance constraints with Verlet integration and Gauss-Seidel projection.
- scene
- Declarative scene description with JSON round-trip and fluent builder. Declarative scene description with JSON round-trip and a fluent builder.
- scheduler
- Priority-based physics step budget allocation per simulation island. Priority-based physics step budget allocation.
- snapshot
- World-state snapshots with delta tracking and ring-buffer history. World-state snapshots with delta tracking and a ring-buffer manager.
- spatial_
grid - Uniform spatial hash grid for fast neighbourhood queries. Uniform spatial hash grid for fast neighbourhood queries.
- telemetry
- Per-step physics telemetry, rolling averages, and CSV export. Physics simulation telemetry — per-step stats, rolling averages, and CSV export.
- trigger
- Trigger/sensor volumes — detect body enter/exit/stay without contact forces. Trigger / sensor volume system.
- xpbd
- Extended Position-Based Dynamics integrator with compliance and Lagrange multipliers. Extended Position-Based Dynamics (XPBD) integrator.
Structs§
- Coupling
Report - Summary statistics produced by one coupler step.
- Coupling
Runtime - Manages a collection of coupled simulation domains.
- FemSph
Coupler - Penalty-based coupler linking a FEM domain (A) to an SPH domain (B).
- Interface
Force - Force to be applied at a single interface site.
- Interface
Force Vec - Owned list of
InterfaceForceentries — heap-allocated, notCopy. - Interface
Site - A single point on the interface between two coupled domains.
- Interface
State - Sampled state at a single interface site.
- Interface
State Vec - Owned list of
InterfaceStateentries — heap-allocated, notCopy. - MdContinuum
Adapter - Penalty coupler bridging an MD domain (A) and a continuum domain (B).
- Mock
Continuum Domain - Mock continuum (FEM/FVM) domain for coupling tests.
- Mock
MdDomain - Mock molecular-dynamics domain for coupling tests.
Enums§
- Domain
Kind - Identifies the physical domain type of a simulation region.
Traits§
- Coupling
Domain - A simulation domain that can participate in cross-domain coupling.
- Domain
Coupler - A coupler that computes interface forces between two coupled domains.