From 00706e8b360e132cb88a7b393dcedadf35403379 Mon Sep 17 00:00:00 2001 From: Crozet Sébastien Date: Tue, 23 Feb 2021 11:24:54 +0100 Subject: Introduce the PhysicsHook trait used for both contact filtering and contact modification. --- src/pipeline/physics_pipeline.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/pipeline/physics_pipeline.rs') diff --git a/src/pipeline/physics_pipeline.rs b/src/pipeline/physics_pipeline.rs index 293fa9d..c030b1d 100644 --- a/src/pipeline/physics_pipeline.rs +++ b/src/pipeline/physics_pipeline.rs @@ -7,8 +7,8 @@ use crate::dynamics::{IntegrationParameters, JointSet, RigidBodySet}; #[cfg(feature = "parallel")] use crate::dynamics::{JointGraphEdge, ParallelIslandSolver as IslandSolver}; use crate::geometry::{ - BroadPhase, BroadPhasePairEvent, ColliderPair, ColliderSet, ContactManifoldIndex, - ContactPairFilter, IntersectionPairFilter, NarrowPhase, + BroadPhase, BroadPhasePairEvent, ColliderPair, ColliderSet, ContactManifoldIndex, NarrowPhase, + PhysicsHooks, }; use crate::math::{Real, Vector}; use crate::pipeline::EventHandler; @@ -69,8 +69,7 @@ impl PhysicsPipeline { bodies: &mut RigidBodySet, colliders: &mut ColliderSet, joints: &mut JointSet, - contact_pair_filter: Option<&dyn ContactPairFilter>, - proximity_pair_filter: Option<&dyn IntersectionPairFilter>, + hooks: &dyn PhysicsHooks, events: &dyn EventHandler, ) { self.counters.step_started(); @@ -115,10 +114,10 @@ impl PhysicsPipeline { integration_parameters.prediction_distance, bodies, colliders, - contact_pair_filter, + hooks, events, ); - narrow_phase.compute_intersections(bodies, colliders, proximity_pair_filter, events); + narrow_phase.compute_intersections(bodies, colliders, hooks, events); // println!("Compute contact time: {}", instant::now() - t); self.counters.stages.island_construction_time.start(); -- cgit