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

@@ -1,6 +1,6 @@
use bevy::prelude::*;
use na::{point, Point3, Point4};
use na::{Point3, Point4, point};
use crate::objects::node::EntityWithGraphics;
use rapier::dynamics::{RigidBodyHandle, RigidBodySet};
@@ -140,11 +140,11 @@ impl GraphicsManager {
let body = body.unwrap_or(RigidBodyHandle::invalid());
if let Some(sns) = self.b2sn.get_mut(&body) {
sns.retain(|sn| {
if let Some(sn_c) = sn.collider {
if sn_c == collider {
commands.entity(sn.entity).despawn();
return false;
}
if let Some(sn_c) = sn.collider
&& sn_c == collider
{
commands.entity(sn.entity).despawn();
return false;
}
true
@@ -236,7 +236,7 @@ impl GraphicsManager {
}
fn gen_color(rng: &mut Pcg32) -> Point3<f32> {
let mut color: Point3<f32> = rng.gen();
let mut color: Point3<f32> = rng.r#gen();
// Quantize the colors a bit to get some amount of auto-instancing from bevy.
color.x = (color.x * 5.0).round() / 5.0;