aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSébastien Crozet <sebcrozet@dimforge.com>2024-03-23 14:47:05 +0100
committerSébastien Crozet <sebastien@crozet.re>2024-03-23 15:17:47 +0100
commitb3a00b4123c85d047b5ab6b89d4d500cc2b92ba6 (patch)
treeb77fce1d0d672ef9888136229e289b314fe38066 /src
parent3d112287b9fd5aa3ddf8c17bc1e6065fa721a9ce (diff)
downloadrapier-b3a00b4123c85d047b5ab6b89d4d500cc2b92ba6.tar.gz
rapier-b3a00b4123c85d047b5ab6b89d4d500cc2b92ba6.tar.bz2
rapier-b3a00b4123c85d047b5ab6b89d4d500cc2b92ba6.zip
feat: add the DefaultBroadPhase type alias
Diffstat (limited to 'src')
-rw-r--r--src/geometry/mod.rs6
-rw-r--r--src/pipeline/collision_pipeline.rs5
2 files changed, 6 insertions, 5 deletions
diff --git a/src/geometry/mod.rs b/src/geometry/mod.rs
index 565f9a3..5d2fb2f 100644
--- a/src/geometry/mod.rs
+++ b/src/geometry/mod.rs
@@ -49,10 +49,12 @@ pub type Aabb = parry::bounding_volume::Aabb;
pub type Ray = parry::query::Ray;
/// The intersection between a ray and a collider.
pub type RayIntersection = parry::query::RayIntersection;
-/// The the projection of a point on a collider.
+/// The projection of a point on a collider.
pub type PointProjection = parry::query::PointProjection;
-/// The the time of impact between two shapes.
+/// The time of impact between two shapes.
pub type TOI = parry::query::TOI;
+/// The default broad-phase implementation provided by Rapier.
+pub type DefaultBroadPhase = BroadPhaseMultiSap;
bitflags::bitflags! {
/// Flags providing more information regarding a collision event.
diff --git a/src/pipeline/collision_pipeline.rs b/src/pipeline/collision_pipeline.rs
index 52f68a3..66bd9ad 100644
--- a/src/pipeline/collision_pipeline.rs
+++ b/src/pipeline/collision_pipeline.rs
@@ -2,8 +2,7 @@
use crate::dynamics::{ImpulseJointSet, MultibodyJointSet};
use crate::geometry::{
- BroadPhase, BroadPhaseMultiSap, BroadPhasePairEvent, ColliderChanges, ColliderHandle,
- ColliderPair, NarrowPhase,
+ BroadPhase, BroadPhasePairEvent, ColliderChanges, ColliderHandle, ColliderPair, NarrowPhase,
};
use crate::math::Real;
use crate::pipeline::{EventHandler, PhysicsHooks, QueryPipeline};
@@ -108,7 +107,7 @@ impl CollisionPipeline {
pub fn step(
&mut self,
prediction_distance: Real,
- broad_phase: &mut BroadPhaseMultiSap,
+ broad_phase: &mut dyn BroadPhase,
narrow_phase: &mut NarrowPhase,
bodies: &mut RigidBodySet,
colliders: &mut ColliderSet,