diff --git a/src/query/intersection_test/intersection_test_composite_shape_shape.rs b/src/query/intersection_test/intersection_test_composite_shape_shape.rs index 3bf4df59..c3a61375 100644 --- a/src/query/intersection_test/intersection_test_composite_shape_shape.rs +++ b/src/query/intersection_test/intersection_test_composite_shape_shape.rs @@ -1,14 +1,10 @@ -#![allow(deprecated)] // Silence warning until we actually remove IntersectionCompositeShapeShapeBestFirstVisitor - use crate::bounding_volume::SimdAabb; -use crate::math::{Isometry, Real, SimdReal, Vector, SIMD_WIDTH}; -use crate::partitioning::{ - SimdBestFirstVisitStatus, SimdBestFirstVisitor, SimdVisitStatus, SimdVisitor, -}; +use crate::math::{Isometry, Real, SIMD_WIDTH}; +use crate::partitioning::{SimdVisitStatus, SimdVisitor}; use crate::query::QueryDispatcher; use crate::shape::{Shape, TypedSimdCompositeShape}; use crate::utils::IsometryOpt; -use simba::simd::{SimdBool as _, SimdPartialOrd, SimdValue}; +use simba::simd::SimdBool as _; /// Intersection test between a composite shape (`Mesh`, `Compound`) and any other shape. pub fn intersection_test_composite_shape_shape( @@ -118,92 +114,3 @@ where SimdVisitStatus::MaybeContinue(mask) } } - -/// A visitor for checking if a composite-shape and a shape intersect. -#[deprecated(note = "Use IntersectionCompositeShapeShapeVisitor instead.")] -pub struct IntersectionCompositeShapeShapeBestFirstVisitor<'a, D: ?Sized, G1: ?Sized + 'a> { - msum_shift: Vector, - msum_margin: Vector, - - dispatcher: &'a D, - pos12: &'a Isometry, - g1: &'a G1, - g2: &'a dyn Shape, -} - -impl<'a, D, G1> IntersectionCompositeShapeShapeBestFirstVisitor<'a, D, G1> -where - D: ?Sized + QueryDispatcher, - G1: ?Sized + TypedSimdCompositeShape, -{ - /// Initialize a visitor for checking if a composite-shape and a shape intersect. - pub fn new( - dispatcher: &'a D, - pos12: &'a Isometry, - g1: &'a G1, - g2: &'a dyn Shape, - ) -> IntersectionCompositeShapeShapeBestFirstVisitor<'a, D, G1> { - let ls_aabb2 = g2.compute_aabb(pos12); - - IntersectionCompositeShapeShapeBestFirstVisitor { - dispatcher, - msum_shift: Vector::splat(-ls_aabb2.center().coords), - msum_margin: Vector::splat(ls_aabb2.half_extents()), - pos12, - g1, - g2, - } - } -} - -impl<'a, D, G1> SimdBestFirstVisitor - for IntersectionCompositeShapeShapeBestFirstVisitor<'a, D, G1> -where - D: ?Sized + QueryDispatcher, - G1: ?Sized + TypedSimdCompositeShape, -{ - type Result = (G1::PartId, bool); - - fn visit( - &mut self, - best: Real, - bv: &SimdAabb, - data: Option<[Option<&G1::PartId>; SIMD_WIDTH]>, - ) -> SimdBestFirstVisitStatus { - // Compute the minkowski sum of the two Aabbs. - let msum = SimdAabb { - mins: bv.mins + self.msum_shift + (-self.msum_margin), - maxs: bv.maxs + self.msum_shift + self.msum_margin, - }; - let dist = msum.distance_to_origin(); - let mask = dist.simd_lt(SimdReal::splat(best)); - - if let Some(data) = data { - let bitmask = mask.bitmask(); - let mut found_intersection = false; - - for (ii, data) in data.into_iter().enumerate() { - if (bitmask & (1 << ii)) != 0 && data.is_some() { - let part_id = *data.unwrap(); - self.g1.map_untyped_part_at(part_id, |part_pos1, g1, _| { - found_intersection = self.dispatcher.intersection_test( - &part_pos1.inv_mul(self.pos12), - g1, - self.g2, - ) == Ok(true); - }); - - if found_intersection { - return SimdBestFirstVisitStatus::ExitEarly(Some((part_id, true))); - } - } - } - } - - SimdBestFirstVisitStatus::MaybeContinue { - weights: dist, - mask, - results: [None; SIMD_WIDTH], - } - } -} diff --git a/src/query/intersection_test/mod.rs b/src/query/intersection_test/mod.rs index fceb5383..a3efc8de 100644 --- a/src/query/intersection_test/mod.rs +++ b/src/query/intersection_test/mod.rs @@ -6,11 +6,9 @@ pub use self::intersection_test_ball_point_query::{ intersection_test_ball_point_query, intersection_test_point_query_ball, }; #[cfg(feature = "std")] -// TODO: remove this once we get rid of IntersectionCompositeShapeShapeBestFirstVisitor -#[allow(deprecated)] pub use self::intersection_test_composite_shape_shape::{ intersection_test_composite_shape_shape, intersection_test_shape_composite_shape, - IntersectionCompositeShapeShapeBestFirstVisitor, IntersectionCompositeShapeShapeVisitor, + IntersectionCompositeShapeShapeVisitor, }; pub use self::intersection_test_cuboid_cuboid::intersection_test_cuboid_cuboid; pub use self::intersection_test_cuboid_segment::{