aboutsummaryrefslogtreecommitdiff
path: root/src/geometry/proximity_detector
diff options
context:
space:
mode:
Diffstat (limited to 'src/geometry/proximity_detector')
-rw-r--r--src/geometry/proximity_detector/trimesh_shape_proximity_detector.rs13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/geometry/proximity_detector/trimesh_shape_proximity_detector.rs b/src/geometry/proximity_detector/trimesh_shape_proximity_detector.rs
index 3dd7381..edf3085 100644
--- a/src/geometry/proximity_detector/trimesh_shape_proximity_detector.rs
+++ b/src/geometry/proximity_detector/trimesh_shape_proximity_detector.rs
@@ -1,11 +1,11 @@
use crate::geometry::proximity_detector::{
PrimitiveProximityDetectionContext, ProximityDetectionContext,
};
-use crate::geometry::{Collider, Proximity, Shape, Trimesh, WAABBHierarchyIntersections};
+use crate::geometry::{Collider, Proximity, Shape, Trimesh};
use crate::ncollide::bounding_volume::{BoundingVolume, AABB};
pub struct TrimeshShapeProximityDetectorWorkspace {
- interferences: WAABBHierarchyIntersections,
+ interferences: Vec<usize>,
local_aabb2: AABB<f32>,
old_interferences: Vec<usize>,
}
@@ -13,7 +13,7 @@ pub struct TrimeshShapeProximityDetectorWorkspace {
impl TrimeshShapeProximityDetectorWorkspace {
pub fn new() -> Self {
Self {
- interferences: WAABBHierarchyIntersections::new(),
+ interferences: Vec::new(),
local_aabb2: AABB::new_invalid(),
old_interferences: Vec::new(),
}
@@ -67,19 +67,20 @@ fn do_detect_proximity(
let local_aabb2 = new_local_aabb2; // .loosened(ctxt.prediction_distance * 2.0); // FIXME: what would be the best value?
std::mem::swap(
&mut workspace.old_interferences,
- &mut workspace.interferences.computed_interferences_mut(),
+ &mut workspace.interferences,
);
+ workspace.interferences.clear();
trimesh1
.waabbs()
- .compute_interferences_with(local_aabb2, &mut workspace.interferences);
+ .intersect_aabb(&local_aabb2, &mut workspace.interferences);
workspace.local_aabb2 = local_aabb2;
}
/*
* Dispatch to the specific solver by keeping the previous manifold if we already had one.
*/
- let new_interferences = workspace.interferences.computed_interferences();
+ let new_interferences = &workspace.interferences;
let mut old_inter_it = workspace.old_interferences.drain(..).peekable();
let mut best_proximity = Proximity::Disjoint;