From 3a1502be74901f3df96a05a7d479f15bd4f8b507 Mon Sep 17 00:00:00 2001 From: Crozet Sébastien Date: Sat, 13 Mar 2021 18:00:58 +0100 Subject: First complete implementation of the hierarchical SAP. --- src/pipeline/physics_pipeline.rs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'src/pipeline/physics_pipeline.rs') diff --git a/src/pipeline/physics_pipeline.rs b/src/pipeline/physics_pipeline.rs index 198c4be..1908fad 100644 --- a/src/pipeline/physics_pipeline.rs +++ b/src/pipeline/physics_pipeline.rs @@ -73,7 +73,6 @@ impl PhysicsPipeline { ) { self.counters.step_started(); bodies.maintain(colliders); - broad_phase.maintain(colliders); narrow_phase.maintain(colliders, bodies); // Update kinematic bodies velocities. @@ -87,19 +86,15 @@ impl PhysicsPipeline { self.counters.stages.collision_detection_time.start(); self.counters.cd.broad_phase_time.start(); + self.broad_phase_events.clear(); self.broadphase_collider_pairs.clear(); - // let t = instant::now(); - broad_phase.update_aabbs( + + broad_phase.update( integration_parameters.prediction_distance, bodies, colliders, + &mut self.broad_phase_events, ); - // println!("Update AABBs time: {}", instant::now() - t); - - // let t = instant::now(); - self.broad_phase_events.clear(); - broad_phase.find_pairs(&mut self.broad_phase_events); - // println!("Find pairs time: {}", instant::now() - t); narrow_phase.register_pairs(colliders, bodies, &self.broad_phase_events, events); self.counters.cd.broad_phase_time.pause(); -- cgit