From 77a6cd3f26525ce6b02b63b34cb68d3a8a444ee2 Mon Sep 17 00:00:00 2001 From: Crozet Sébastien Date: Sun, 11 Jul 2021 18:41:51 +0200 Subject: Release v0.10.0 --- CHANGELOG.md | 9 +++++++++ benchmarks2d/joint_ball2.rs | 4 ++-- benchmarks2d/joint_fixed2.rs | 4 ++-- benchmarks2d/joint_prismatic2.rs | 2 +- benchmarks3d/joint_ball3.rs | 4 ++-- benchmarks3d/joint_fixed3.rs | 4 ++-- benchmarks3d/joint_prismatic3.rs | 2 +- benchmarks3d/joint_revolute3.rs | 8 ++++---- build/rapier2d-f64/Cargo.toml | 6 +++--- build/rapier2d/Cargo.toml | 6 +++--- build/rapier3d-f64/Cargo.toml | 6 +++--- build/rapier3d/Cargo.toml | 6 +++--- build/rapier_testbed2d/Cargo.toml | 12 ++++++------ build/rapier_testbed3d/Cargo.toml | 12 ++++++------ examples2d/joints2.rs | 4 ++-- examples3d/debug_prismatic3.rs | 2 +- examples3d/joints3.rs | 24 +++++++++++------------ src/dynamics/joint/joint_set.rs | 1 - src/pipeline/query_pipeline.rs | 41 +++++++++++++++++++-------------------- 19 files changed, 82 insertions(+), 75 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 34be16f..0fdda0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## v0.10.0 +### Added +- Implement `Clone` for `IslandManager`. + +### Modified +- `JointSet::insert` no longer takes the rigid-body set in its arguments. +- Modify the testbed's plugin system to let plugins interact with the rendering. +- Implement `PartialEq` for most collider and rigid-body components. + ## v0.9.2 ### Added - Make the method JointSet::remove_joints_attached_to_rigid_body public so that it can can be called externally for diff --git a/benchmarks2d/joint_ball2.rs b/benchmarks2d/joint_ball2.rs index aadf91e..114fe85 100644 --- a/benchmarks2d/joint_ball2.rs +++ b/benchmarks2d/joint_ball2.rs @@ -42,7 +42,7 @@ pub fn init_world(testbed: &mut Testbed) { if i > 0 { let parent_handle = *body_handles.last().unwrap(); let joint = BallJoint::new(Point::origin(), point![0.0, shift]); - joints.insert(&mut bodies, parent_handle, child_handle, joint); + joints.insert(parent_handle, child_handle, joint); } // Horizontal joint. @@ -50,7 +50,7 @@ pub fn init_world(testbed: &mut Testbed) { let parent_index = body_handles.len() - numi; let parent_handle = body_handles[parent_index]; let joint = BallJoint::new(Point::origin(), point![-shift, 0.0]); - joints.insert(&mut bodies, parent_handle, child_handle, joint); + joints.insert(parent_handle, child_handle, joint); } body_handles.push(child_handle); diff --git a/benchmarks2d/joint_fixed2.rs b/benchmarks2d/joint_fixed2.rs index baaa250..8d6e8dc 100644 --- a/benchmarks2d/joint_fixed2.rs +++ b/benchmarks2d/joint_fixed2.rs @@ -50,7 +50,7 @@ pub fn init_world(testbed: &mut Testbed) { Isometry::identity(), Isometry::translation(0.0, shift), ); - joints.insert(&mut bodies, parent_handle, child_handle, joint); + joints.insert(parent_handle, child_handle, joint); } // Horizontal joint. @@ -61,7 +61,7 @@ pub fn init_world(testbed: &mut Testbed) { Isometry::identity(), Isometry::translation(-shift, 0.0), ); - joints.insert(&mut bodies, parent_handle, child_handle, joint); + joints.insert(parent_handle, child_handle, joint); } body_handles.push(child_handle); diff --git a/benchmarks2d/joint_prismatic2.rs b/benchmarks2d/joint_prismatic2.rs index 0cbf859..c2b4bf3 100644 --- a/benchmarks2d/joint_prismatic2.rs +++ b/benchmarks2d/joint_prismatic2.rs @@ -51,7 +51,7 @@ pub fn init_world(testbed: &mut Testbed) { prism.limits_enabled = true; prism.limits[0] = -1.5; prism.limits[1] = 1.5; - joints.insert(&mut bodies, curr_parent, curr_child, prism); + joints.insert(curr_parent, curr_child, prism); curr_parent = curr_child; } diff --git a/benchmarks3d/joint_ball3.rs b/benchmarks3d/joint_ball3.rs index 5e3eb10..a1661f8 100644 --- a/benchmarks3d/joint_ball3.rs +++ b/benchmarks3d/joint_ball3.rs @@ -37,7 +37,7 @@ pub fn init_world(testbed: &mut Testbed) { if i > 0 { let parent_handle = *body_handles.last().unwrap(); let joint = BallJoint::new(Point::origin(), point![0.0, 0.0, -shift]); - joints.insert(&mut bodies, parent_handle, child_handle, joint); + joints.insert(parent_handle, child_handle, joint); } // Horizontal joint. @@ -45,7 +45,7 @@ pub fn init_world(testbed: &mut Testbed) { let parent_index = body_handles.len() - num; let parent_handle = body_handles[parent_index]; let joint = BallJoint::new(Point::origin(), point![-shift, 0.0, 0.0]); - joints.insert(&mut bodies, parent_handle, child_handle, joint); + joints.insert(parent_handle, child_handle, joint); } body_handles.push(child_handle); diff --git a/benchmarks3d/joint_fixed3.rs b/benchmarks3d/joint_fixed3.rs index 5647dde..3d1e317 100644 --- a/benchmarks3d/joint_fixed3.rs +++ b/benchmarks3d/joint_fixed3.rs @@ -53,7 +53,7 @@ pub fn init_world(testbed: &mut Testbed) { Isometry::identity(), Isometry::translation(0.0, 0.0, -shift), ); - joints.insert(&mut bodies, parent_handle, child_handle, joint); + joints.insert(parent_handle, child_handle, joint); } // Horizontal joint. @@ -64,7 +64,7 @@ pub fn init_world(testbed: &mut Testbed) { Isometry::identity(), Isometry::translation(-shift, 0.0, 0.0), ); - joints.insert(&mut bodies, parent_handle, child_handle, joint); + joints.insert(parent_handle, child_handle, joint); } body_handles.push(child_handle); diff --git a/benchmarks3d/joint_prismatic3.rs b/benchmarks3d/joint_prismatic3.rs index b310b14..b011662 100644 --- a/benchmarks3d/joint_prismatic3.rs +++ b/benchmarks3d/joint_prismatic3.rs @@ -59,7 +59,7 @@ pub fn init_world(testbed: &mut Testbed) { prism.limits_enabled = true; prism.limits[0] = -2.0; prism.limits[1] = 2.0; - joints.insert(&mut bodies, curr_parent, curr_child, prism); + joints.insert(curr_parent, curr_child, prism); curr_parent = curr_child; } diff --git a/benchmarks3d/joint_revolute3.rs b/benchmarks3d/joint_revolute3.rs index 7c0f6cb..d6dc06c 100644 --- a/benchmarks3d/joint_revolute3.rs +++ b/benchmarks3d/joint_revolute3.rs @@ -61,10 +61,10 @@ pub fn init_world(testbed: &mut Testbed) { RevoluteJoint::new(o, x, point![shift, 0.0, 0.0], x), ]; - joints.insert(&mut bodies, curr_parent, handles[0], revs[0]); - joints.insert(&mut bodies, handles[0], handles[1], revs[1]); - joints.insert(&mut bodies, handles[1], handles[2], revs[2]); - joints.insert(&mut bodies, handles[2], handles[3], revs[3]); + joints.insert(curr_parent, handles[0], revs[0]); + joints.insert(handles[0], handles[1], revs[1]); + joints.insert(handles[1], handles[2], revs[2]); + joints.insert(handles[2], handles[3], revs[3]); curr_parent = handles[3]; } diff --git a/build/rapier2d-f64/Cargo.toml b/build/rapier2d-f64/Cargo.toml index e65adbf..5502543 100644 --- a/build/rapier2d-f64/Cargo.toml +++ b/build/rapier2d-f64/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rapier2d-f64" -version = "0.9.2" +version = "0.10.0" authors = [ "Sébastien Crozet " ] description = "2-dimensional physics engine in Rust." documentation = "http://docs.rs/rapier2d" @@ -47,8 +47,8 @@ required-features = [ "dim2", "f64" ] vec_map = { version = "0.8", optional = true } instant = { version = "0.1", features = [ "now" ]} num-traits = "0.2" -nalgebra = "0.27" -parry2d-f64 = "0.5" +nalgebra = "0.28" +parry2d-f64 = "0.6" simba = "0.5" approx = "0.5" rayon = { version = "1", optional = true } diff --git a/build/rapier2d/Cargo.toml b/build/rapier2d/Cargo.toml index d16f64c..524e491 100644 --- a/build/rapier2d/Cargo.toml +++ b/build/rapier2d/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rapier2d" -version = "0.9.2" +version = "0.10.0" authors = [ "Sébastien Crozet " ] description = "2-dimensional physics engine in Rust." documentation = "http://docs.rs/rapier2d" @@ -47,8 +47,8 @@ required-features = [ "dim2", "f32" ] vec_map = { version = "0.8", optional = true } instant = { version = "0.1", features = [ "now" ]} num-traits = "0.2" -nalgebra = "0.27" -parry2d = "0.5" +nalgebra = "0.28" +parry2d = "0.6" simba = "0.5" approx = "0.5" rayon = { version = "1", optional = true } diff --git a/build/rapier3d-f64/Cargo.toml b/build/rapier3d-f64/Cargo.toml index d96c248..ff3c421 100644 --- a/build/rapier3d-f64/Cargo.toml +++ b/build/rapier3d-f64/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rapier3d-f64" -version = "0.9.2" +version = "0.10.0" authors = [ "Sébastien Crozet " ] description = "3-dimensional physics engine in Rust." documentation = "http://docs.rs/rapier3d" @@ -47,8 +47,8 @@ required-features = [ "dim3", "f64" ] vec_map = { version = "0.8", optional = true } instant = { version = "0.1", features = [ "now" ]} num-traits = "0.2" -nalgebra = "0.27" -parry3d-f64 = "0.5" +nalgebra = "0.28" +parry3d-f64 = "0.6" simba = "0.5" approx = "0.5" rayon = { version = "1", optional = true } diff --git a/build/rapier3d/Cargo.toml b/build/rapier3d/Cargo.toml index 3d5b23f..e1d991a 100644 --- a/build/rapier3d/Cargo.toml +++ b/build/rapier3d/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rapier3d" -version = "0.9.2" +version = "0.10.0" authors = [ "Sébastien Crozet " ] description = "3-dimensional physics engine in Rust." documentation = "http://docs.rs/rapier3d" @@ -47,8 +47,8 @@ required-features = [ "dim3", "f32" ] vec_map = { version = "0.8", optional = true } instant = { version = "0.1", features = [ "now" ]} num-traits = "0.2" -nalgebra = "0.27" -parry3d = "0.5" +nalgebra = "0.28" +parry3d = "0.6" simba = "0.5" approx = "0.5" rayon = { version = "1", optional = true } diff --git a/build/rapier_testbed2d/Cargo.toml b/build/rapier_testbed2d/Cargo.toml index f038bff..8f34e92 100644 --- a/build/rapier_testbed2d/Cargo.toml +++ b/build/rapier_testbed2d/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rapier_testbed2d" -version = "0.9.0" +version = "0.10.0" authors = [ "Sébastien Crozet " ] description = "Testbed for the Rapier 2-dimensional physics engine in Rust." homepage = "http://rapier.org" @@ -26,16 +26,16 @@ other-backends = [ "wrapped2d", "nphysics2d" ] [dependencies] -nalgebra = { version = "0.27", features = [ "rand" ] } +nalgebra = { version = "0.28", features = [ "rand" ] } rand = "0.8" rand_pcg = "0.3" instant = { version = "0.1", features = [ "web-sys", "now" ]} bitflags = "1" num_cpus = { version = "1", optional = true } wrapped2d = { version = "0.4", optional = true } -parry2d = "0.5" -ncollide2d = "0.30" -nphysics2d = { version = "0.22", optional = true } +parry2d = "0.6" +ncollide2d = "0.31" +nphysics2d = { version = "0.23", optional = true } crossbeam = "0.8" bincode = "1" Inflector = "0.11" @@ -54,5 +54,5 @@ bevy_webgl2 = "0.5" [dependencies.rapier2d] path = "../rapier2d" -version = "0.9" +version = "0.10" features = [ "serde-serialize" ] diff --git a/build/rapier_testbed3d/Cargo.toml b/build/rapier_testbed3d/Cargo.toml index 600a341..7aa6722 100644 --- a/build/rapier_testbed3d/Cargo.toml +++ b/build/rapier_testbed3d/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rapier_testbed3d" -version = "0.9.0" +version = "0.10.0" authors = [ "Sébastien Crozet " ] description = "Testbed for the Rapier 3-dimensional physics engine in Rust." homepage = "http://rapier.org" @@ -25,16 +25,16 @@ parallel = [ "rapier3d/parallel", "num_cpus" ] other-backends = [ "physx", "physx-sys", "glam", "nphysics3d" ] [dependencies] -nalgebra = { version = "0.27", features = [ "rand" ] } +nalgebra = { version = "0.28", features = [ "rand" ] } rand = "0.8" rand_pcg = "0.3" instant = { version = "0.1", features = [ "web-sys", "now" ]} bitflags = "1" glam = { version = "0.12", optional = true } num_cpus = { version = "1", optional = true } -parry3d = "0.5" -ncollide3d = "0.30" -nphysics3d = { version = "0.22", optional = true } +parry3d = "0.6" +ncollide3d = "0.31" +nphysics3d = { version = "0.23", optional = true } physx = { version = "0.11", optional = true } physx-sys = { version = "0.4", optional = true } crossbeam = "0.8" @@ -56,5 +56,5 @@ bevy_webgl2 = "0.5" [dependencies.rapier3d] path = "../rapier3d" -version = "0.9" +version = "0.10" features = [ "serde-serialize" ] \ No newline at end of file diff --git a/examples2d/joints2.rs b/examples2d/joints2.rs index 9c94968..9333184 100644 --- a/examples2d/joints2.rs +++ b/examples2d/joints2.rs @@ -45,7 +45,7 @@ pub fn init_world(testbed: &mut Testbed) { if i > 0 { let parent_handle = *body_handles.last().unwrap(); let joint = BallJoint::new(Point::origin(), point![0.0, shift]); - joints.insert(&mut bodies, parent_handle, child_handle, joint); + joints.insert(parent_handle, child_handle, joint); } // Horizontal joint. @@ -53,7 +53,7 @@ pub fn init_world(testbed: &mut Testbed) { let parent_index = body_handles.len() - numi; let parent_handle = body_handles[parent_index]; let joint = BallJoint::new(Point::origin(), point![-shift, 0.0]); - joints.insert(&mut bodies, parent_handle, child_handle, joint); + joints.insert(parent_handle, child_handle, joint); } body_handles.push(child_handle); diff --git a/examples3d/debug_prismatic3.rs b/examples3d/debug_prismatic3.rs index f41ef49..43c6cc0 100644 --- a/examples3d/debug_prismatic3.rs +++ b/examples3d/debug_prismatic3.rs @@ -51,7 +51,7 @@ fn prismatic_repro( let (stiffness, damping) = (0.05, 0.2); prismatic.configure_motor_position(0.0, stiffness, damping); - joints.insert(bodies, box_rb, wheel_rb, prismatic); + joints.insert(box_rb, wheel_rb, prismatic); } // put a small box under one of the wheels diff --git a/examples3d/joints3.rs b/examples3d/joints3.rs index e22f293..fc64693 100644 --- a/examples3d/joints3.rs +++ b/examples3d/joints3.rs @@ -46,7 +46,7 @@ fn create_prismatic_joints( prism.limits[0] = -2.0; prism.limits[1] = 2.0; - joints.insert(bodies, curr_parent, curr_child, prism); + joints.insert(curr_parent, curr_child, prism); curr_parent = curr_child; } @@ -113,7 +113,7 @@ fn create_actuated_prismatic_joints( prism.limits[1] = 5.0; } - joints.insert(bodies, curr_parent, curr_child, prism); + joints.insert(curr_parent, curr_child, prism); curr_parent = curr_child; } @@ -168,10 +168,10 @@ fn create_revolute_joints( RevoluteJoint::new(o, x, point![shift, 0.0, 0.0], x), ]; - joints.insert(bodies, curr_parent, handles[0], revs[0]); - joints.insert(bodies, handles[0], handles[1], revs[1]); - joints.insert(bodies, handles[1], handles[2], revs[2]); - joints.insert(bodies, handles[2], handles[3], revs[3]); + joints.insert(curr_parent, handles[0], revs[0]); + joints.insert(handles[0], handles[1], revs[1]); + joints.insert(handles[1], handles[2], revs[2]); + joints.insert(handles[2], handles[3], revs[3]); curr_parent = handles[3]; } @@ -221,7 +221,7 @@ fn create_fixed_joints( Isometry::identity(), Isometry::translation(0.0, 0.0, -shift), ); - joints.insert(bodies, parent_handle, child_handle, joint); + joints.insert(parent_handle, child_handle, joint); } // Horizontal joint. @@ -232,7 +232,7 @@ fn create_fixed_joints( Isometry::identity(), Isometry::translation(-shift, 0.0, 0.0), ); - joints.insert(bodies, parent_handle, child_handle, joint); + joints.insert(parent_handle, child_handle, joint); } body_handles.push(child_handle); @@ -273,7 +273,7 @@ fn create_ball_joints( if i > 0 { let parent_handle = *body_handles.last().unwrap(); let joint = BallJoint::new(Point::origin(), point![0.0, 0.0, -shift * 2.0]); - joints.insert(bodies, parent_handle, child_handle, joint); + joints.insert(parent_handle, child_handle, joint); } // Horizontal joint. @@ -281,7 +281,7 @@ fn create_ball_joints( let parent_index = body_handles.len() - num; let parent_handle = body_handles[parent_index]; let joint = BallJoint::new(Point::origin(), point![-shift, 0.0, 0.0]); - joints.insert(bodies, parent_handle, child_handle, joint); + joints.insert(parent_handle, child_handle, joint); } body_handles.push(child_handle); @@ -348,7 +348,7 @@ fn create_actuated_revolute_joints( joint.configure_motor_velocity(-2.0, 0.1); } - joints.insert(bodies, parent_handle, child_handle, joint); + joints.insert(parent_handle, child_handle, joint); } parent_handle = child_handle; @@ -406,7 +406,7 @@ fn create_actuated_ball_joints( ); } - joints.insert(bodies, parent_handle, child_handle, joint); + joints.insert(parent_handle, child_handle, joint); } parent_handle = child_handle; diff --git a/src/dynamics/joint/joint_set.rs b/src/dynamics/joint/joint_set.rs index d2373ec..01e0d27 100644 --- a/src/dynamics/joint/joint_set.rs +++ b/src/dynamics/joint/joint_set.rs @@ -172,7 +172,6 @@ impl JointSet { /// Inserts a new joint into this set and retrieve its handle. pub fn insert( &mut self, - _bodies: &mut impl ComponentSetMut, // FIXME: remove this argument, this is no longer necessary. body1: RigidBodyHandle, body2: RigidBodyHandle, joint_params: J, diff --git a/src/pipeline/query_pipeline.rs b/src/pipeline/query_pipeline.rs index 733d767..160ae07 100644 --- a/src/pipeline/query_pipeline.rs +++ b/src/pipeline/query_pipeline.rs @@ -35,7 +35,7 @@ pub struct QueryPipeline { serde(skip, default = "crate::geometry::default_query_dispatcher") )] query_dispatcher: Arc, - quadtree: QBVH, + qbvh: QBVH, tree_built: bool, dilation_factor: Real, } @@ -98,8 +98,8 @@ where self.map_typed_part_at(shape_id, f); } - fn typed_quadtree(&self) -> &QBVH { - &self.query_pipeline.quadtree + fn typed_qbvh(&self) -> &QBVH { + &self.query_pipeline.qbvh } } @@ -139,7 +139,7 @@ impl QueryPipeline { { Self { query_dispatcher: Arc::new(d), - quadtree: QBVH::new(), + qbvh: QBVH::new(), tree_built: false, dilation_factor: 0.01, } @@ -285,8 +285,7 @@ impl QueryPipeline { colliders, mode, }; - self.quadtree - .clear_and_rebuild(generator, self.dilation_factor); + self.qbvh.clear_and_rebuild(generator, self.dilation_factor); // FIXME: uncomment this once we handle insertion/removals properly. // self.tree_built = true; @@ -296,13 +295,13 @@ impl QueryPipeline { for handle in islands.iter_active_bodies() { let body_colliders: &RigidBodyColliders = bodies.index(handle.0); for handle in &body_colliders.0 { - self.quadtree.pre_update(*handle) + self.qbvh.pre_update(*handle) } } match mode { QueryPipelineMode::CurrentPosition => { - self.quadtree.update( + self.qbvh.update( |handle| { let (co_pos, co_shape): (&ColliderPosition, &ColliderShape) = colliders.index_bundle(handle.0); @@ -312,7 +311,7 @@ impl QueryPipeline { ); } QueryPipelineMode::SweepTestWithNextPosition => { - self.quadtree.update( + self.qbvh.update( |handle| { let co_parent: Option<&ColliderParent> = colliders.get(handle.0); let (co_pos, co_shape): (&ColliderPosition, &ColliderShape) = @@ -330,7 +329,7 @@ impl QueryPipeline { ); } QueryPipelineMode::SweepTestWithPredictedPosition { dt } => { - self.quadtree.update( + self.qbvh.update( |handle| { let co_parent: Option<&ColliderParent> = colliders.get(handle.0); let (co_pos, co_shape): (&ColliderPosition, &ColliderShape) = @@ -392,7 +391,7 @@ impl QueryPipeline { let mut visitor = RayCompositeShapeToiBestFirstVisitor::new(&pipeline_shape, ray, max_toi, solid); - self.quadtree.traverse_best_first(&mut visitor).map(|h| h.1) + self.qbvh.traverse_best_first(&mut visitor).map(|h| h.1) } /// Find the closest intersection between a ray and a set of collider. @@ -432,7 +431,7 @@ impl QueryPipeline { solid, ); - self.quadtree.traverse_best_first(&mut visitor).map(|h| h.1) + self.qbvh.traverse_best_first(&mut visitor).map(|h| h.1) } /// Find the all intersections between a ray and a set of collider and passes them to a callback. @@ -486,7 +485,7 @@ impl QueryPipeline { }; let mut visitor = RayIntersectionsVisitor::new(ray, max_toi, &mut leaf_callback); - self.quadtree.traverse_depth_first(&mut visitor); + self.qbvh.traverse_depth_first(&mut visitor); } /// Gets the handle of up to one collider intersecting the given shape. @@ -521,7 +520,7 @@ impl QueryPipeline { shape, ); - self.quadtree + self.qbvh .traverse_best_first(&mut visitor) .map(|h| (h.1 .0)) } @@ -558,7 +557,7 @@ impl QueryPipeline { let mut visitor = PointCompositeShapeProjBestFirstVisitor::new(&pipeline_shape, point, solid); - self.quadtree + self.qbvh .traverse_best_first(&mut visitor) .map(|h| (h.1 .1, h.1 .0)) } @@ -607,7 +606,7 @@ impl QueryPipeline { let mut visitor = PointIntersectionsVisitor::new(point, &mut leaf_callback); - self.quadtree.traverse_depth_first(&mut visitor); + self.qbvh.traverse_depth_first(&mut visitor); } /// Find the projection of a point on the closest collider. @@ -642,7 +641,7 @@ impl QueryPipeline { let pipeline_shape = self.as_composite_shape(colliders, query_groups, filter); let mut visitor = PointCompositeShapeProjWithFeatureBestFirstVisitor::new(&pipeline_shape, point, false); - self.quadtree + self.qbvh .traverse_best_first(&mut visitor) .map(|h| (h.1 .1 .0, h.1 .0, h.1 .1 .1)) } @@ -654,7 +653,7 @@ impl QueryPipeline { mut callback: impl FnMut(&ColliderHandle) -> bool, ) { let mut visitor = BoundingVolumeIntersectionsVisitor::new(aabb, &mut callback); - self.quadtree.traverse_depth_first(&mut visitor); + self.qbvh.traverse_depth_first(&mut visitor); } /// Casts a shape at a constant linear velocity and retrieve the first collider it hits. @@ -698,7 +697,7 @@ impl QueryPipeline { shape, max_toi, ); - self.quadtree.traverse_best_first(&mut visitor).map(|h| h.1) + self.qbvh.traverse_best_first(&mut visitor).map(|h| h.1) } /// Casts a shape with an arbitrary continuous motion and retrieve the first collider it hits. @@ -749,7 +748,7 @@ impl QueryPipeline { end_time, stop_at_penetration, ); - self.quadtree.traverse_best_first(&mut visitor).map(|h| h.1) + self.qbvh.traverse_best_first(&mut visitor).map(|h| h.1) } /// Retrieve all the colliders intersecting the given shape. @@ -805,6 +804,6 @@ impl QueryPipeline { let shape_aabb = shape.compute_aabb(shape_pos); let mut visitor = BoundingVolumeIntersectionsVisitor::new(&shape_aabb, &mut leaf_callback); - self.quadtree.traverse_depth_first(&mut visitor); + self.qbvh.traverse_depth_first(&mut visitor); } } -- cgit