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:
@@ -1,5 +1,5 @@
|
||||
use rapier3d::prelude::*;
|
||||
use rapier_testbed3d::Testbed;
|
||||
use rapier3d::prelude::*;
|
||||
|
||||
const MAX_NUMBER_OF_BODIES: usize = 400;
|
||||
|
||||
@@ -17,10 +17,13 @@ pub fn init_world(testbed: &mut Testbed) {
|
||||
let ground_size = 100.1;
|
||||
let ground_height = 2.1; // 16.0;
|
||||
|
||||
let rigid_body = RigidBodyBuilder::fixed().translation(vector![0.0, -ground_height, 0.0]);
|
||||
let handle = bodies.insert(rigid_body);
|
||||
let collider = ColliderBuilder::cuboid(ground_size, ground_height, ground_size);
|
||||
colliders.insert_with_parent(collider, handle, &mut bodies);
|
||||
for k in 0..3 {
|
||||
let rigid_body =
|
||||
RigidBodyBuilder::fixed().translation(vector![0.0, -ground_height - k as f32, 0.0]);
|
||||
let handle = bodies.insert(rigid_body);
|
||||
let collider = ColliderBuilder::cuboid(ground_size, ground_height, ground_size);
|
||||
colliders.insert_with_parent(collider, handle, &mut bodies);
|
||||
}
|
||||
|
||||
// Callback that will be executed on the main loop to handle proximities.
|
||||
testbed.add_callback(move |mut graphics, physics, _, run_state| {
|
||||
@@ -55,7 +58,7 @@ pub fn init_world(testbed: &mut Testbed) {
|
||||
.reverse()
|
||||
});
|
||||
|
||||
let num_to_remove = to_remove.len() - MAX_NUMBER_OF_BODIES;
|
||||
let num_to_remove = to_remove.len().saturating_sub(MAX_NUMBER_OF_BODIES);
|
||||
for (handle, _) in &to_remove[..num_to_remove] {
|
||||
physics.bodies.remove(
|
||||
*handle,
|
||||
|
||||
Reference in New Issue
Block a user