Skip to main content

Crate oxiphysics_core

Crate oxiphysics_core 

Source
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.
AdamsBashforth2
Adams-Bashforth 2-step explicit integrator.
BodyHandle
Handle to a rigid body, with generation counter for safe reuse.
BoundingBox3D
A 3-D axis-aligned bounding box with richer query helpers.
Capsule
A capsule: a line segment swept by a sphere.
ColliderHandle
Handle to a collider, with generation counter for safe reuse.
ContactPoint
A contact point produced by narrowphase collision detection.
DefaultConfigs
Pre-built configurations for common physics scenarios.
DiagnosticInfo
Diagnostic information attached to an error for debugging.
ErrorCollector
Collect multiple errors during a batch operation.
ExplicitEuler
Classic explicit (forward) Euler integrator.
ImplicitEuler
Implicit (backward) Euler integrator — unconditionally stable.
LayerFilter
A simple bitmask-based collision filter.
Leapfrog
Leapfrog (Störmer-Verlet) integration.
MassProperties
Mass properties of a rigid body.
Midpoint
Explicit midpoint (Runge-Kutta 2) integrator.
PbdDistanceConstraint
A simple PBD distance constraint between two particles.
PhysicsConfig
Global physics configuration.
PhysicsConfigBuilder
Builder for PhysicsConfig with a fluent API.
PhysicsMaterial
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).
RayAabbHit
Result of a ray–AABB intersection test.
RungeKutta4
4th-order Runge-Kutta integrator (position only, given an acceleration field).
SemiImplicitEuler
Semi-implicit (symplectic) Euler integrator.
SolverDiagnostics
Tracks solver convergence history and diagnostics.
Sphere
A sphere in 3D space.
SphereSensor
A spherical proximity sensor.
TimeStep
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.
VelocityVerlet
Velocity Verlet integration scheme.

Enums§

Error
Main error type for the core module (legacy)
ErrorSeverity
Severity level for physics errors.
PhysicsError
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.
CollisionFilter
Trait for filtering which body pairs participate in collision detection.
Damped
Trait for objects that model energy dissipation.
ForceSource
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.
PhysicsBody
Trait for objects that represent a physics body.
PhysicsConstraint
Trait for position/velocity-level constraints between bodies.
PhysicsDiagnostics
Trait for physics objects that can emit diagnostic information.
PhysicsInterpolatable
Trait for physics state objects that support linear interpolation.
PhysicsSensor
Trait for physics sensors (trigger volumes, proximity detectors, etc.).
PhysicsStateful
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, otherwise Err(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) if index < max, otherwise Err(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) if value >= 0, otherwise Err(InvalidInput).
check_poisson_ratio
Check Poisson’s ratio is in the valid range (-1, 0.5) for 3D.
check_positive
Returns Ok(value) if value > 0, otherwise Err(InvalidInput).
check_range
Returns Ok(value) if min <= value <= max, otherwise Err(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§

PhysicsResult
Result alias using PhysicsError.
Result
Result type alias (legacy)