feat: reduce the amount of duplicate work the broad-phase is doing for user changes and CCD + release v0.28.0 (#872)
* feat: reduce the amount of duplicate work the broad-phase is doing for user changes and CCD * Release v0.28.0 * chore: fix warnings * chore: clippy fixes * chore: more clippy fixes
This commit is contained in:
@@ -13,7 +13,7 @@ other-backends = ["rapier_testbed2d/other-backends"]
|
||||
enhanced-determinism = ["rapier2d/enhanced-determinism"]
|
||||
|
||||
[dependencies]
|
||||
rand = "0.8"
|
||||
rand = "0.9"
|
||||
lyon = "0.17"
|
||||
usvg = "0.14"
|
||||
dot_vox = "5"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use rand::distributions::{Distribution, Standard};
|
||||
use rand::distr::{Distribution, StandardUniform};
|
||||
use rand::{SeedableRng, rngs::StdRng};
|
||||
use rapier_testbed2d::Testbed;
|
||||
use rapier2d::prelude::*;
|
||||
@@ -48,7 +48,7 @@ pub fn init_world(testbed: &mut Testbed) {
|
||||
let centery = shift / 2.0;
|
||||
|
||||
let mut rng = StdRng::seed_from_u64(0);
|
||||
let distribution = Standard;
|
||||
let distribution = StandardUniform;
|
||||
|
||||
for i in 0..num {
|
||||
for j in 0usize..num * 4 {
|
||||
|
||||
@@ -42,10 +42,7 @@ pub fn init_world(testbed: &mut Testbed) {
|
||||
testbed.add_callback(move |mut graphics, physics, _, run| {
|
||||
let slow_time = run.timestep_id as f32 / 3.0;
|
||||
|
||||
let Some(broad_phase) = physics.broad_phase.downcast_ref::<BroadPhaseBvh>() else {
|
||||
return;
|
||||
};
|
||||
let query_pipeline = broad_phase.as_query_pipeline(
|
||||
let query_pipeline = physics.broad_phase.as_query_pipeline(
|
||||
physics.narrow_phase.query_dispatcher(),
|
||||
&physics.bodies,
|
||||
&physics.colliders,
|
||||
|
||||
@@ -137,10 +137,7 @@ fn update_kinematic_controller(
|
||||
let character_shape = character_collider.shared_shape().clone();
|
||||
let character_mass = character_body.mass();
|
||||
|
||||
let Some(broad_phase) = phx.broad_phase.downcast_ref::<BroadPhaseBvh>() else {
|
||||
return;
|
||||
};
|
||||
let mut query_pipeline = broad_phase.as_query_pipeline_mut(
|
||||
let mut query_pipeline = phx.broad_phase.as_query_pipeline_mut(
|
||||
phx.narrow_phase.query_dispatcher(),
|
||||
&mut phx.bodies,
|
||||
&mut phx.colliders,
|
||||
|
||||
Reference in New Issue
Block a user