Skip to main content

Crate oxiphysics_collision

Crate oxiphysics_collision 

Source
Expand description

Collision detection algorithms including broad-phase and narrow-phase.

Provides broadphase (brute force, sweep-and-prune, BVH), narrowphase (GJK, EPA, specialized sphere/box/capsule tests), and contact manifold generation.

Re-exports§

pub use types::CollisionEvent;
pub use types::CollisionFilter;
pub use types::CollisionPair;
pub use types::Contact;
pub use types::ContactManifold;
pub use types::FeatureId;
pub use types::MAX_CONTACTS;
pub use types::PhysicsMaterial;
pub use types::RichContact;
pub use types::RichContactManifold;
pub use broadphase::BroadPhase;
pub use broadphase::BruteForceBroadPhase;
pub use broadphase::BvhBroadphase;
pub use broadphase::SweepAndPrune;
pub use dbvt::BvhAabb;
pub use dbvt::DynamicBvh;
pub use narrowphase::BatchNarrowPhase;
pub use narrowphase::ContactFilter;
pub use narrowphase::NarrowPhaseContact;
pub use narrowphase::ShapeKind;
pub use narrowphase::shape_shape_contact;
pub use narrowphase::Epa;
pub use narrowphase::Gjk;
pub use narrowphase::NarrowPhaseDispatcher;
pub use ccd::CcdBodyEntry;
pub use ccd::CcdPair;
pub use ccd::CcdPipeline;
pub use ccd::CcdPipelineConfig;
pub use ccd::ConservativeAdvancement;
pub use ccd::RigidBodyState;
pub use ccd::ToiResult;
pub use ccd::advance_body_to;
pub use ccd::integrate_angular;
pub use ccd::integrate_linear;
pub use ccd::quat_mul;
pub use ccd::quat_normalize;
pub use ccd::quat_rotate;
pub use ccd::slerp_quat;
pub use ccd::time_of_impact;
pub use sweep::RayHit;
pub use sweep::SweepResult;
pub use sweep::aabb_aabb_overlap;
pub use sweep::point_aabb_dist_sq;
pub use sweep::ray_aabb;
pub use sweep::ray_sphere;
pub use sweep::ray_triangle;
pub use sweep::sphere_aabb_overlap;
pub use sweep::swept_aabb_aabb;
pub use sweep::swept_sphere_aabb;
pub use sweep::swept_sphere_sphere;
pub use gjk_epa::ConvexShape;
pub use gjk_epa::EpaFace;
pub use gjk_epa::EpaResult;
pub use gjk_epa::GjkBox;
pub use gjk_epa::GjkCapsule;
pub use gjk_epa::GjkSphere;
pub use gjk_epa::Simplex;
pub use gjk_epa::add3;
pub use gjk_epa::cross3;
pub use gjk_epa::do_simplex;
pub use gjk_epa::dot3;
pub use gjk_epa::epa;
pub use gjk_epa::gjk_distance;
pub use gjk_epa::gjk_epa_contact;
pub use gjk_epa::gjk_intersect;
pub use gjk_epa::len3;
pub use gjk_epa::minkowski_support;
pub use gjk_epa::normalize3;
pub use gjk_epa::scale3;
pub use gjk_epa::sub3;
pub use contact_graph::ContactCache;
pub use contact_graph::ContactGraph;
pub use contact_graph::ContactKey;
pub use contact_graph::PersistedContact;
pub use contact_graph::SpeculativeContact;
pub use contact_graph::speculative_contact;
pub use contact_graph::speculative_impulse;
pub use manifold_cache::CachingStrategy;
pub use manifold_cache::ContactIsland;
pub use manifold_cache::ContactManifoldCache;
pub use manifold_cache::ContactPointId;
pub use manifold_cache::ManifoldCompressor;
pub use manifold_cache::ManifoldLifetimeManager;
pub use manifold_cache::ManifoldMetrics;
pub use manifold_cache::ManifoldPointMatcher;
pub use manifold_cache::ManifoldReduction;
pub use manifold_cache::PersistentManifold;
pub use manifold_cache::age_cache_warm_start;
pub use manifold_cache::age_manifold_warm_start;
pub use manifold_cache::age_warm_start;
pub use manifold_cache::apply_position_corrections;
pub use manifold_cache::baumgarte_correction;
pub use manifold_cache::baumgarte_correction_slop;
pub use manifold_cache::build_contact_islands;
pub use manifold_cache::compute_manifold_metrics;
pub use manifold_cache::find_match_with_strategy;
pub use sat_collision::Capsule as SatCapsule;
pub use sat_collision::ContactFeature;
pub use sat_collision::ContactManifoldBuilder;
pub use sat_collision::ConvexPolyhedraSat;
pub use sat_collision::ConvexPolyhedron;
pub use sat_collision::ConvexPolytope;
pub use sat_collision::Obb;
pub use sat_collision::ObbBvh;
pub use sat_collision::ObbBvhNode;
pub use sat_collision::ObbCapsuleCollision;
pub use sat_collision::ObbCollision;
pub use sat_collision::ObbTree;
pub use sat_collision::ObbTriangleCollision;
pub use sat_collision::PolyhedraContact;
pub use sat_collision::PolytopeCollision;
pub use sat_collision::SatAxisCache;
pub use sat_collision::SatContact;
pub use sat_collision::SatContactPointGenerator;
pub use sat_collision::closest_points_on_segments;
pub use sat_collision::edge_edge_contact;
pub use sat_collision::obb_bvh_pair_query;
pub use sat_collision::obb_overlap_on_axis;
pub use sat_collision::obb_project;
pub use recast::RecastBuilder;
pub use recast::RecastConfig;
pub use recast::RecastError;

Modules§

broadphase
Auto-generated module structure
ccd
Continuous Collision Detection (CCD) via conservative advancement.
compound_shapes
Compound and complex shape handling for collision detection.
contact_generation
Advanced contact manifold generation for collision detection.
contact_graph
Contact graph persistence and speculative contacts.
contact_manifold
Contact manifold generation and management.
dbvt
Auto-generated module structure
deformable_collision
Auto-generated module structure
fluid_collision
Fluid-solid collision and coupling for the OxiPhysics collision crate.
gjk_enhanced
Auto-generated module structure
gjk_epa
GJK (Gilbert-Johnson-Keerthi) and EPA (Expanding Polytope Algorithm) for convex shape collision detection using plain [f64; 3] arrays.
gjk_extended
Extended GJK/EPA algorithms.
joint_collision
Joint-limit collision: revolute, prismatic, and ball-socket angle limits modelled as constraints. Covers soft/hard stops, gear-ratio response, cable/chain limits, articulated-body joint stops, motor hard limits, joint friction as a constraint, compliance at limits, and warm-starting.
kdtree_collision
KD-tree based spatial queries and collision detection.
manifold_cache
Persistent contact manifold caching and warm-starting for stable simulation. Persistent contact manifold caching for stable simulation.
mesh_collision
Mesh collision detection: BVH for triangle meshes (AABB tree build/query), triangle-triangle intersection (Möller-Trumbore), mesh-mesh broad+narrow phase, deformable mesh collision (BVH refit), cloth self-collision, continuous collision detection for deformables, proximity query (distance field), swept triangle vs static mesh, penetration depth estimation, and contact manifold generation.
narrowphase
Auto-generated module structure
parallel_collision
Auto-generated module structure
proximity
Proximity query algorithms for collision detection.
proximity_query
Advanced proximity queries for collision detection.
query
Auto-generated module structure
ray_casting
Auto-generated module structure
recast
Recast-equivalent navmesh construction from triangle soup.
sap
Auto-generated module structure
sat_collision
Separating Axis Theorem (SAT) collision detection for OBBs and convex shapes. Auto-generated module structure
shape_cast
Shape casting (continuous collision detection / swept queries).
soft_body_collision
Soft body and cloth collision detection and response.
softbody_collision
Soft body collision detection: deformable meshes, cloth, self-collision.
spatial_queries
Advanced spatial queries.
sweep
Swept-primitive collision queries.
terrain_collision
Auto-generated module structure
types
Core collision detection types.
voxel_collision
Voxel-based collision detection.

Structs§

ContextualCollector
Like ErrorCollector but stores ContextualError values.
ContextualError
An Error decorated with the body-pair indices that triggered it.
ErrorBudget
Tracks per-category error budgets for rate-limited triage.
ErrorCollector
Collects multiple non-fatal errors so the caller can inspect them in bulk after a simulation step, rather than short-circuiting on the first failure.
ErrorStats
Accumulates error counts per kind and severity for a simulation step.
RetryPolicy
Specifies how many times a failed collision query should be retried.

Enums§

Error
Main error type for the collision module.
ErrorKind
Coarse classification of Error variants for programmatic branching.
RecoveryHint
Suggested recovery action for a failed collision query.
Severity
Severity level for runtime triage and logging.

Type Aliases§

Result
Result type alias.