Skip to content

Commit 0a116a9

Browse files
authored
Merge branch 'dimforge:master' into fix-voxel-dim-calc
2 parents 4ea142f + aefe2a6 commit 0a116a9

20 files changed

+24
-28
lines changed

src/partitioning/qbvh/update.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ impl<LeafData: IndexedData> Qbvh<LeafData> {
377377
workspace.to_sort.extend(0..workspace.orig_ids.len());
378378
let root_id = NodeIndex::new(0, 0);
379379

380-
let mut indices = std::mem::replace(&mut workspace.to_sort, vec![]);
380+
let mut indices = std::mem::take(&mut workspace.to_sort);
381381
let (id, aabb) = self.do_recurse_rebalance(&mut indices, workspace, root_id, margin);
382382
workspace.to_sort = indices;
383383

src/query/contact_manifolds/contact_manifold.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ impl<ManifoldData, ContactData: Default + Copy> ContactManifold<ManifoldData, Co
141141
#[cfg(feature = "dim2")]
142142
let points = self.points.clone();
143143
#[cfg(feature = "dim3")]
144-
let points = std::mem::replace(&mut self.points, Vec::new());
144+
let points = std::mem::take(&mut self.points);
145145
self.points.clear();
146146

147147
ContactManifold {

src/query/contact_manifolds/contact_manifolds_composite_shape_composite_shape.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ pub fn contact_manifolds_composite_shape_composite_shape<'a, ManifoldData, Conta
9898

9999
// Traverse qbvh1 first.
100100
let ls_aabb2_1 = ls_aabb2.transform_by(&pos12).loosened(prediction);
101-
let mut old_manifolds = std::mem::replace(manifolds, Vec::new());
101+
let mut old_manifolds = std::mem::take(manifolds);
102102

103103
let mut leaf_fn1 = |leaf1: &u32| {
104104
composite1.map_part_at(*leaf1, &mut |part_pos1, part_shape1| {

src/query/contact_manifolds/contact_manifolds_composite_shape_shape.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ pub fn contact_manifolds_composite_shape_shape<ManifoldData, ContactData>(
8484

8585
// Traverse qbvh1 first.
8686
let ls_aabb2_1 = shape2.compute_aabb(&pos12).loosened(prediction);
87-
let mut old_manifolds = std::mem::replace(manifolds, Vec::new());
87+
let mut old_manifolds = std::mem::take(manifolds);
8888

8989
let mut leaf1_fn = |leaf1: &u32| {
9090
composite1.map_part_at(*leaf1, &mut |part_pos1, part_shape1| {

src/query/contact_manifolds/contact_manifolds_halfspace_pfm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pub fn contact_manifold_halfspace_pfm<'a, ManifoldData, ContactData, S2>(
5858

5959
// We do this clone to perform contact tracking and transfer impulses.
6060
// FIXME: find a more efficient way of doing this.
61-
let old_manifold_points = std::mem::replace(&mut manifold.points, Default::default());
61+
let old_manifold_points = std::mem::take(&mut manifold.points);
6262

6363
for i in 0..feature2.num_vertices {
6464
let vtx2 = feature2.vertices[i];

src/query/contact_manifolds/contact_manifolds_heightfield_composite_shape.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ pub fn contact_manifolds_heightfield_composite_shape<ManifoldData, ContactData>(
9191
let qbvh2 = composite2.qbvh();
9292
let mut stack2 = Vec::new();
9393
let ls_aabb2_1 = qbvh2.root_aabb().transform_by(pos12).loosened(prediction);
94-
let mut old_manifolds = std::mem::replace(manifolds, Vec::new());
94+
let mut old_manifolds = std::mem::take(manifolds);
9595

9696
heightfield1.map_elements_in_local_aabb(&ls_aabb2_1, &mut |leaf1, part1| {
9797
#[cfg(feature = "dim2")]

src/query/contact_manifolds/contact_manifolds_heightfield_shape.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ pub fn contact_manifolds_heightfield_shape<ManifoldData, ContactData>(
125125
*/
126126
// TODO: somehow precompute the Aabb and reuse it?
127127
let ls_aabb2 = shape2.compute_aabb(pos12).loosened(prediction);
128-
let mut old_manifolds = std::mem::replace(manifolds, Vec::new());
128+
let mut old_manifolds = std::mem::take(manifolds);
129129

130130
heightfield1.map_elements_in_local_aabb(&ls_aabb2, &mut |i, part1| {
131131
#[cfg(feature = "dim2")]

src/query/epa/epa2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ impl EPA {
346346

347347
let best_face = &self.faces[best_face_id.id];
348348
let cpts = best_face.closest_points(&self.vertices);
349-
return Some((cpts.0, cpts.1, best_face.normal));
349+
Some((cpts.0, cpts.1, best_face.normal))
350350
}
351351
}
352352

src/query/epa/epa3.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ impl EPA {
418418

419419
let best_face = &self.faces[best_face_id.id];
420420
let points = best_face.closest_points(&self.vertices);
421-
return Some((points.0, points.1, best_face.normal));
421+
Some((points.0, points.1, best_face.normal))
422422
}
423423

424424
fn compute_silhouette(&mut self, point: usize, id: usize, opp_pt_id: usize) {

src/query/gjk/voronoi_simplex2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ impl VoronoiSimplex {
5555

5656
self.dim += 1;
5757
self.vertices[self.dim] = pt;
58-
return true;
58+
true
5959
}
6060

6161
/// Retrieves the barycentric coordinate associated to the `i`-th by the last call to `project_origin_and_reduce`.

0 commit comments

Comments
 (0)