diff options
| author | Crozet Sébastien <developer@crozet.re> | 2021-07-11 18:41:51 +0200 |
|---|---|---|
| committer | Sébastien Crozet <sebastien@crozet.re> | 2021-07-11 19:21:50 +0200 |
| commit | 77a6cd3f26525ce6b02b63b34cb68d3a8a444ee2 (patch) | |
| tree | d7ad31295739f685a486d6653175630718a34760 /src | |
| parent | 9233a855f0fd13e61c475b32117838af95fb4c93 (diff) | |
| download | rapier-0.10.0.tar.gz rapier-0.10.0.tar.bz2 rapier-0.10.0.zip | |
Release v0.10.0v0.10.0
Diffstat (limited to 'src')
| -rw-r--r-- | src/dynamics/joint/joint_set.rs | 1 | ||||
| -rw-r--r-- | src/pipeline/query_pipeline.rs | 41 |
2 files changed, 20 insertions, 22 deletions
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<J>( &mut self, - _bodies: &mut impl ComponentSetMut<RigidBodyIds>, // 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<dyn QueryDispatcher>, - quadtree: QBVH<ColliderHandle>, + qbvh: QBVH<ColliderHandle>, tree_built: bool, dilation_factor: Real, } @@ -98,8 +98,8 @@ where self.map_typed_part_at(shape_id, f); } - fn typed_quadtree(&self) -> &QBVH<ColliderHandle> { - &self.query_pipeline.quadtree + fn typed_qbvh(&self) -> &QBVH<ColliderHandle> { + &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); } } |
