diff options
| author | Robert Hrusecky <robert.hrusecky@utexas.edu> | 2020-10-06 14:22:26 -0500 |
|---|---|---|
| committer | Robert Hrusecky <robert.hrusecky@utexas.edu> | 2020-10-06 14:22:26 -0500 |
| commit | dd8e25bc4756b8bd01d283b5d7e7c5daa9a1af3f (patch) | |
| tree | 43a0e92a698d5c622edf406dfdd27037471a5e24 /src/geometry/contact_generator | |
| parent | 0c1b210109e6d4816dc54f2a6dc93e8d6beb5089 (diff) | |
| parent | 6b1cd9cd404bd1da6aec94527e58dcd483a50c67 (diff) | |
| download | rapier-dd8e25bc4756b8bd01d283b5d7e7c5daa9a1af3f.tar.gz rapier-dd8e25bc4756b8bd01d283b5d7e7c5daa9a1af3f.tar.bz2 rapier-dd8e25bc4756b8bd01d283b5d7e7c5daa9a1af3f.zip | |
Merge branch 'master' into infinite_fall_memory
Diffstat (limited to 'src/geometry/contact_generator')
| -rw-r--r-- | src/geometry/contact_generator/heightfield_shape_contact_generator.rs | 8 | ||||
| -rw-r--r-- | src/geometry/contact_generator/trimesh_shape_contact_generator.rs | 13 |
2 files changed, 11 insertions, 10 deletions
diff --git a/src/geometry/contact_generator/heightfield_shape_contact_generator.rs b/src/geometry/contact_generator/heightfield_shape_contact_generator.rs index f59a94b..04afc65 100644 --- a/src/geometry/contact_generator/heightfield_shape_contact_generator.rs +++ b/src/geometry/contact_generator/heightfield_shape_contact_generator.rs @@ -71,10 +71,10 @@ fn do_generate_contacts( } else { manifold.subshape_index_pair.1 }; - println!( - "Restoring for {} [chosen with {:?}]", - subshape_id, manifold.subshape_index_pair - ); + // println!( + // "Restoring for {} [chosen with {:?}]", + // subshape_id, manifold.subshape_index_pair + // ); // Use dummy shapes for the dispatch. #[cfg(feature = "dim2")] diff --git a/src/geometry/contact_generator/trimesh_shape_contact_generator.rs b/src/geometry/contact_generator/trimesh_shape_contact_generator.rs index 78f26bb..52ba9b7 100644 --- a/src/geometry/contact_generator/trimesh_shape_contact_generator.rs +++ b/src/geometry/contact_generator/trimesh_shape_contact_generator.rs @@ -1,11 +1,11 @@ use crate::geometry::contact_generator::{ ContactGenerationContext, PrimitiveContactGenerationContext, }; -use crate::geometry::{Collider, ContactManifold, Shape, Trimesh, WAABBHierarchyIntersections}; +use crate::geometry::{Collider, ContactManifold, Shape, Trimesh}; use crate::ncollide::bounding_volume::{BoundingVolume, AABB}; pub struct TrimeshShapeContactGeneratorWorkspace { - interferences: WAABBHierarchyIntersections, + interferences: Vec<usize>, local_aabb2: AABB<f32>, old_interferences: Vec<usize>, old_manifolds: Vec<ContactManifold>, @@ -14,7 +14,7 @@ pub struct TrimeshShapeContactGeneratorWorkspace { impl TrimeshShapeContactGeneratorWorkspace { pub fn new() -> Self { Self { - interferences: WAABBHierarchyIntersections::new(), + interferences: Vec::new(), local_aabb2: AABB::new_invalid(), old_interferences: Vec::new(), old_manifolds: Vec::new(), @@ -74,7 +74,7 @@ fn do_generate_contacts( 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, - workspace.interferences.computed_interferences_mut(), + &mut workspace.interferences, ); std::mem::swap(&mut workspace.old_manifolds, &mut ctxt.pair.manifolds); ctxt.pair.manifolds.clear(); @@ -108,16 +108,17 @@ fn do_generate_contacts( // workspace.old_manifolds.len() // ); + 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 old_manifolds_it = workspace.old_manifolds.drain(..); |
