Skip to main content

Crate oxiphysics

Crate oxiphysics 

Source
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

ModuleDescription
coreMath types, traits, ODE solvers, stochastic processes
geometryShape primitives and mesh utilities
collisionBroad-phase and narrow-phase collision detection
rigidRigid body dynamics
articulatedFeatherstone articulated-body dynamics (RNEA + ABA)
constraintsConstraint / joint solvers
vehicleVehicle dynamics simulation
sphSmoothed-particle hydrodynamics
lbmLattice Boltzmann method
femFinite element method
mdMolecular dynamics
softbodySoft body / cloth simulation
materialsMaterial property database
gpuGPU acceleration backends
vizVisualization helpers
ioFile I/O and serialization
pipelineFull simulation pipeline
force_fieldSpatial force fields (gravity wells, vortex, explosion)
event_busPhysics event publish/subscribe system
replayDeterministic simulation replay (record → replay)
querySpatial queries — raycasting, sphere sweeps, overlaps
sceneDeclarative scene description with JSON round-trip
snapshotWorld-state snapshots with delta tracking
triggerTrigger/sensor volumes — enter/exit/stay events
animationKeyframe animation tracks (Vec3 + quaternion SLERP)
material_tableRuntime material interaction table with combine rules
debug_drawRenderer-agnostic debug draw command buffer
contact_cachePersistent contact pair cache with warm-start impulses
buoyancyArchimedes buoyancy and drag forces for fluid volumes
schedulerPriority-based physics step budget allocation per island
spatial_gridUniform spatial hash grid for fast neighbourhood queries
lodLevel-of-Detail simulation tier management
noiseProcedural 3D value noise and fractal Brownian motion
interpolatorSmooth damp, exp decay, spring followers, lerp utilities
telemetryPer-step physics stats, rolling averages, CSV export
characterKinematic capsule character controller with sweep-and-slide, step-up, and slope handling
ropeRope / chain distance constraints with Verlet integration and Gauss-Seidel projection
xpbdExtended Position-Based Dynamics integrator with compliance and Lagrange multipliers
ikInverse kinematics — FABRIK and 2-bone analytic IK with joint cone limits
profilerHierarchical scoped profiler with RAII guards, frame reports, and flamegraph export
aeroAerodynamics — velocity-squared drag and airfoil lift/drag forces
navmeshNavigation mesh with A* pathfinding and funnel-algorithm path smoothing
rollbackSnapshot-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§

CouplingReport
Summary statistics produced by one coupler step.
CouplingRuntime
Manages a collection of coupled simulation domains.
FemSphCoupler
Penalty-based coupler linking a FEM domain (A) to an SPH domain (B).
InterfaceForce
Force to be applied at a single interface site.
InterfaceForceVec
Owned list of InterfaceForce entries — heap-allocated, not Copy.
InterfaceSite
A single point on the interface between two coupled domains.
InterfaceState
Sampled state at a single interface site.
InterfaceStateVec
Owned list of InterfaceState entries — heap-allocated, not Copy.
MdContinuumAdapter
Penalty coupler bridging an MD domain (A) and a continuum domain (B).
MockContinuumDomain
Mock continuum (FEM/FVM) domain for coupling tests.
MockMdDomain
Mock molecular-dynamics domain for coupling tests.

Enums§

DomainKind
Identifies the physical domain type of a simulation region.

Traits§

CouplingDomain
A simulation domain that can participate in cross-domain coupling.
DomainCoupler
A coupler that computes interface forces between two coupled domains.