feat: switch to the new Bvh from parry for the broad-phase (#853)

* feat: switch to the new Bvh from parry for the broad-phase

* chore: cargo fmt + update testbed

* chore: remove the multi-grid SAP broad-phase

* fix soft-ccd handling in broad-phase

* Fix contact cleanup in broad-phase after collider removal

* chore: clippy fixes

* fix CCD regression

* chore: update changelog

* fix build with the parallel feature enabled

* chore: remove the now useless broad-phase proxy index from colliders

* fix tests
This commit is contained in:
Sébastien Crozet
2025-07-11 22:36:40 +02:00
committed by GitHub
parent 86a257d4f1
commit 95bd6fcfeb
212 changed files with 2140 additions and 3953 deletions

View File

@@ -4,10 +4,10 @@ use rapier::dynamics::{
RigidBodySet,
};
use rapier::geometry::{
ColliderSet, CollisionEvent, ContactForceEvent, DefaultBroadPhase, NarrowPhase,
BroadPhase, ColliderSet, CollisionEvent, ContactForceEvent, DefaultBroadPhase, NarrowPhase,
};
use rapier::math::{Real, Vector};
use rapier::pipeline::{PhysicsHooks, PhysicsPipeline, QueryPipeline};
use rapier::pipeline::{PhysicsHooks, PhysicsPipeline};
pub struct PhysicsSnapshot {
timestep_id: usize,
@@ -76,7 +76,7 @@ impl PhysicsSnapshot {
+ self.colliders.len()
+ self.impulse_joints.len()
+ self.multibody_joints.len();
println!("Snapshot length: {}B", total);
println!("Snapshot length: {total}B");
println!("|_ broad_phase: {}B", self.broad_phase.len());
println!("|_ narrow_phase: {}B", self.narrow_phase.len());
println!("|_ island_manager: {}B", self.island_manager.len());
@@ -89,7 +89,7 @@ impl PhysicsSnapshot {
pub struct PhysicsState {
pub islands: IslandManager,
pub broad_phase: DefaultBroadPhase,
pub broad_phase: Box<dyn BroadPhase>,
pub narrow_phase: NarrowPhase,
pub bodies: RigidBodySet,
pub colliders: ColliderSet,
@@ -97,7 +97,6 @@ pub struct PhysicsState {
pub multibody_joints: MultibodyJointSet,
pub ccd_solver: CCDSolver,
pub pipeline: PhysicsPipeline,
pub query_pipeline: QueryPipeline,
pub integration_parameters: IntegrationParameters,
pub gravity: Vector<Real>,
pub hooks: Box<dyn PhysicsHooks>,
@@ -113,7 +112,7 @@ impl PhysicsState {
pub fn new() -> Self {
Self {
islands: IslandManager::new(),
broad_phase: DefaultBroadPhase::default(),
broad_phase: Box::new(DefaultBroadPhase::default()),
narrow_phase: NarrowPhase::new(),
bodies: RigidBodySet::new(),
colliders: ColliderSet::new(),
@@ -121,7 +120,6 @@ impl PhysicsState {
multibody_joints: MultibodyJointSet::new(),
ccd_solver: CCDSolver::new(),
pipeline: PhysicsPipeline::new(),
query_pipeline: QueryPipeline::new(),
integration_parameters: IntegrationParameters::default(),
gravity: Vector::y() * -9.81,
hooks: Box::new(()),