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 --- src/dynamics/joint/joint_set.rs | 1 - src/pipeline/query_pipeline.rs | 41 ++++++++++++++++++++--------------------- 2 files changed, 20 insertions(+), 22 deletions(-) (limited to 'src') 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