Expand description
Core types, traits, and abstractions for the OxiPhysics engine.
This crate provides fundamental building blocks used across all OxiPhysics sub-crates, including vector/quaternion types, transforms, bounding volumes, and core simulation traits.
All other OxiPhysics crates should import math types from
oxiphysics_core::math rather than depending on nalgebra directly.
Re-exports§
pub use linalg::characteristic_poly3;pub use linalg::det3;pub use linalg::frobenius_norm3;pub use linalg::inv3;pub use linalg::is_symmetric3;pub use linalg::polar_decomp3;pub use linalg::qr_decomp3;pub use linalg::solve3;pub use linalg::svd3;pub use linalg::symmetric_eigen3;pub use linalg::symmetric_eigenvalues3;pub use linalg::trace3;pub use stochastic::GeometricBrownianMotion;pub use stochastic::LangevinDynamics;pub use stochastic::OrnsteinUhlenbeck;pub use stochastic::RandomWalk;pub use stochastic::Rng;pub use stochastic::WienerProcess;pub use stochastic::autocorrelation;pub use stochastic::diffusion_coefficient;pub use stochastic::euler_maruyama;pub use stochastic::milstein;pub use world::Body;pub use world::BodyArena;pub use world::BodyMode;pub use world::BodyVelocity;pub use world::Constraint;pub use world::ConstraintKind;pub use world::Island;pub use world::PhysicsEvent;pub use world::PhysicsWorld;pub use crate::math::Mat3;pub use crate::math::Quat;pub use crate::math::Real;pub use crate::math::Vec3;pub use dual_quaternion::*;pub use interpolation::*;pub use numerics::*;pub use statistics::*;pub use tensor::*;
Modules§
- adaptive_
timestepping - Unified adaptive time-stepping module for multi-domain physics simulations.
- autodiff
- Forward-mode automatic differentiation using dual numbers.
- bayesian_
inference - Bayesian inference: priors, likelihoods, posterior updates, MCMC, Bayesian linear regression, Gaussian processes, and model selection.
- bayesian_
opt - Bayesian optimization with Gaussian process surrogates.
- cache_
layout - Cache-optimized data layouts for particle-based simulations.
- category_
theory - Auto-generated module structure
- causal_
inference - Causal inference and structural causal models.
- chaos_
theory - Chaos theory and nonlinear dynamics.
- collision
- Collision detection primitives: GJK/EPA narrowphase, SAT, sphere/capsule tests, BVH broadphase, and contact manifold generation.
- complex
- Auto-generated module structure
- complex_
analysis - Complex analysis, special functions, and conformal mappings.
- compressed_
sensing - Compressed sensing and sparse signal recovery algorithms.
- continuation
- Numerical continuation and bifurcation analysis.
- control
- Control theory and systems: PID, state-space, transfer functions, Bode analysis, LQR, Kalman filter, MPC, adaptive control, fuzzy control, and neural controller.
- control_
systems - Auto-generated module structure
- control_
theory - Control theory: PID, state-space, LQR, Kalman filter, EKF, Bode analysis, root locus, Ziegler-Nichols auto-tuning, lead/lag compensator, poles/zeros.
- convex_
analysis - Convex analysis, proximal operators, and constrained optimisation.
- differential_
geometry - Auto-generated module structure
- dimensionless
- Dimensionless number calculations and similarity analysis.
- dual_
quaternion - Dual quaternions for rigid body transformations and screw motions.
- dynamic_
systems - Dynamical systems — maps, flows, bifurcations, synchronisation.
- dynamical_
systems - Dynamical systems analysis: ODE fixed points, Lyapunov exponents, bifurcations, phase plane, Poincaré sections, strange attractors, chaos indicators (RQA), Hamiltonian systems, KAM tori, and symplectic integration.
- ergodic_
theory - Ergodic theory and dynamical systems analysis.
- finite_
difference - Finite difference schemes for PDEs in 1D, 2D, and 3D.
- formal_
verification - Formal verification methods for physics simulation correctness.
- fractional_
calculus - Fractional calculus module for the OxiPhysics engine.
- functional_
analysis - Functional analysis tools for physics simulation.
- game_
theory - Auto-generated module structure
- geometry_
primitives - Low-level geometry primitives: Ray, AABB, Sphere, Plane, Triangle, Capsule, OrientedBox, Frustum, convex polyhedron, and barycentric coordinates.
- graph
- Auto-generated module structure
- information_
geometry - Information geometry and statistical manifolds.
- information_
theory - Auto-generated module structure
- interpolation
- Auto-generated module structure
- interval
- Auto-generated module structure
- linalg
- Auto-generated module structure
- machine_
learning - Auto-generated module structure
- math
- Core math types and operations for the OxiPhysics engine.
- measure_
theory - Measure theory: sigma-algebras, Lebesgue measure, probability measures, signed measures, product measures, and numerical Lebesgue/Monte Carlo integration.
- metric_
spaces - Metric space abstractions and concrete metric implementations.
- monte_
carlo - Monte Carlo methods for physics simulation.
- multiscale_
methods - Auto-generated module structure
- network_
dynamics - Network/graph dynamics: epidemic models, opinion dynamics, synchronization.
- neural_
ode - Neural ODE (continuous-depth neural networks) implementations.
- numerical_
integration - Numerical integration methods.
- numerical_
linear_ algebra - Auto-generated module structure
- numerical_
methods - Numerical methods: root finding, ODE solvers, BVP, finite differences, numerical differentiation, quadrature, matrix decompositions, eigensolvers, continuation methods, and bifurcation detection.
- numerical_
methods_ ext - Extended numerical methods: integral equations, BEM, radial basis functions.
- numerical_
ode - Numerical ODE solvers with event detection and dense output.
- numerics
- Numerical algorithms for physics simulation.
- ode
- Auto-generated module structure
- optimization
- Auto-generated module structure
- parallel
- Auto-generated module structure
- parallel_
orchestrator - Parallel solver orchestration for multi-stage physics pipelines.
- pde
- Auto-generated module structure
- pde_
solvers - Finite-difference PDE solvers for common one-dimensional equations.
- persistent_
homology - Persistent homology and topological data analysis.
- petri_
nets - Petri net modeling for concurrent discrete event systems.
- probabilistic_
models - Probabilistic models including Bayesian networks, HMMs, Gaussian processes, Dirichlet processes, variational inference, and expectation-maximization.
- quadrature
- Numerical quadrature (numerical integration) methods.
- random
- Auto-generated module structure
- random_
processes - Random processes: Brownian motion, Poisson processes, Markov chains, continuous-time Markov chains, Lévy processes, and SDE solvers.
- renormalization_
group - Renormalization group (RG) theory computations.
- sampling
- Auto-generated module structure
- signal
- Auto-generated module structure
- signal_
analysis - Signal analysis: autocorrelation, cross-correlation, PSD, Hilbert transform, empirical mode decomposition, peak detection, and signal filtering.
- signal_
processing - Signal processing: FFT, windowing, filtering, spectral analysis, wavelets.
- simd_
math - SIMD-accelerated math kernels for batch vector and particle operations.
- sparse
- Auto-generated module structure
- spatial
- Auto-generated module structure
- spectral_
methods - Spectral methods for numerical analysis and physics simulations.
- stability
- API stability markers for OxiPhysics.
- statistical_
mechanics - Statistical mechanics: ensembles, Ising model, phase transitions, fluctuation-dissipation, Green-Kubo relations, and equations of state.
- statistics
- Auto-generated module structure
- stochastic
- Auto-generated module structure
- stochastic_
processes - Stochastic processes for simulation and financial/physical modeling.
- symbolic_
algebra - Auto-generated module structure
- symbolic_
math - Symbolic mathematics: expression trees, evaluation, differentiation, and simplification.
- tensor
- Tensor algebra operations for continuum mechanics.
- time_
series_ analysis - Time-series analysis utilities: statistics, filtering, autocorrelation, trend decomposition, spectral analysis, change-point detection, and AR models.
- topological_
data - Topological Data Analysis (TDA) — persistent homology utilities.
- topology
- Computational topology and algebraic topology.
- topology_
optimization - Topology optimization methods including SIMP, level-set, and manufacturing filters.
- uncertainty_
quantification - Uncertainty Quantification (UQ) methods for physics simulation.
- unit_
conversion - Unit conversion and fundamental physical constants.
- wavelet_
transform - Auto-generated module structure
- wavelets
- Wavelet transforms for signal analysis in physics simulations.
- world
- Auto-generated module structure
Structs§
- Aabb
- Axis-aligned bounding box for broad-phase collision detection.
- Adams
Bashforth2 - Adams-Bashforth 2-step explicit integrator.
- Body
Handle - Handle to a rigid body, with generation counter for safe reuse.
- Bounding
Box3D - A 3-D axis-aligned bounding box with richer query helpers.
- Capsule
- A capsule: a line segment swept by a sphere.
- Collider
Handle - Handle to a collider, with generation counter for safe reuse.
- Contact
Point - A contact point produced by narrowphase collision detection.
- Default
Configs - Pre-built configurations for common physics scenarios.
- Diagnostic
Info - Diagnostic information attached to an error for debugging.
- Error
Collector - Collect multiple errors during a batch operation.
- Explicit
Euler - Classic explicit (forward) Euler integrator.
- Implicit
Euler - Implicit (backward) Euler integrator — unconditionally stable.
- Layer
Filter - A simple bitmask-based collision filter.
- Leapfrog
- Leapfrog (Störmer-Verlet) integration.
- Mass
Properties - Mass properties of a rigid body.
- Midpoint
- Explicit midpoint (Runge-Kutta 2) integrator.
- PbdDistance
Constraint - A simple PBD distance constraint between two particles.
- Physics
Config - Global physics configuration.
- Physics
Config Builder - Builder for PhysicsConfig with a fluent API.
- Physics
Material - Physical surface properties.
- Plane
- An infinite plane defined by normal and offset.
- Plane3D
- An infinite plane stored with plain
[f64; 3]arrays (no nalgebra). - Ray
- A ray in 3D space defined by an origin and a unit-direction vector.
- Ray3D
- A ray in 3-D space stored with plain
[f64; 3]arrays (no nalgebra). - RayAabb
Hit - Result of a ray–AABB intersection test.
- Runge
Kutta4 - 4th-order Runge-Kutta integrator (position only, given an acceleration field).
- Semi
Implicit Euler - Semi-implicit (symplectic) Euler integrator.
- Solver
Diagnostics - Tracks solver convergence history and diagnostics.
- Sphere
- A sphere in 3D space.
- Sphere
Sensor - A spherical proximity sensor.
- Time
Step - A discrete simulation time step.
- Transform
- Transform representing position and orientation in 3D space.
- Transform3D
- A 3-D transform stored as position + quaternion (xyzw) + uniform scale,
using plain arrays to avoid nalgebra dependencies outside
oxiphysics-core. - Triangle
- A triangle in 3D space.
- Velocity
Verlet - Velocity Verlet integration scheme.
Enums§
- Error
- Main error type for the core module (legacy)
- Error
Severity - Severity level for physics errors.
- Physics
Error - Unified error type for the physics engine.
Traits§
- Broadphase
- Trait for broadphase collision detection structures.
- Collidable
- Trait for objects that can participate in collision detection.
- Collision
Filter - Trait for filtering which body pairs participate in collision detection.
- Damped
- Trait for objects that model energy dissipation.
- Force
Source - Trait for objects that apply forces to bodies (gravity fields, springs, etc.).
- HasMaterial
- Trait for objects that expose a surface material.
- Integrator
- Trait for numerical time integrators.
- Narrowphase
- Trait for narrowphase collision queries.
- PbdConstraint
- Trait for PBD position constraints.
- Physics
Body - Trait for objects that represent a physics body.
- Physics
Constraint - Trait for position/velocity-level constraints between bodies.
- Physics
Diagnostics - Trait for physics objects that can emit diagnostic information.
- Physics
Interpolatable - Trait for physics state objects that support linear interpolation.
- Physics
Sensor - Trait for physics sensors (trigger volumes, proximity detectors, etc.).
- Physics
Stateful - Trait for objects whose full physics state can be captured and restored.
- Renderable
- Trait for physics objects that can provide render-ready data.
- Sleepable
- Trait for bodies that can sleep when below activity thresholds.
- Steppable
- Trait for objects that can be stepped forward in time.
Functions§
- check_
finite - Returns
Ok(value)if finite, otherwiseErr(NumericalDivergence). - check_
finite_ slice - Check that a slice contains no NaN or infinite values.
- check_
finite_ vec3 - Check that a 3D vector has finite components.
- check_
index - Returns
Ok(index)ifindex < max, otherwiseErr(OutOfBounds). - check_
lbm_ mach - Check that the LBM Mach number is below the stability limit.
- check_
md_ timestep - Check that an MD time step is reasonable (positive and not too large).
- check_
non_ negative - Returns
Ok(value)ifvalue >= 0, otherwiseErr(InvalidInput). - check_
poisson_ ratio - Check Poisson’s ratio is in the valid range (-1, 0.5) for 3D.
- check_
positive - Returns
Ok(value)ifvalue > 0, otherwiseErr(InvalidInput). - check_
range - Returns
Ok(value)ifmin <= value <= max, otherwiseErr(InvalidInput). - check_
sph_ density - Check that SPH density is positive.
- contact_
impulse_ scalar - Velocity-level constraint impulse for a contact constraint (Baumgarte-free).
- fabrik_
solve - FABRIK (Forward And Backward Reaching Inverse Kinematics) solver.
- pbd_
solve_ iteration - Solve one PBD iteration over a set of constraints.
- xpbd_
distance_ correction - XPBD position-level constraint correction for a distance constraint.
Type Aliases§
- Physics
Result - Result alias using
PhysicsError. - Result
- Result type alias (legacy)