aboutsummaryrefslogtreecommitdiff
path: root/src/dynamics/solver/velocity_ground_constraint_wide.rs
diff options
context:
space:
mode:
authorSébastien Crozet <developer@crozet.re>2022-03-06 10:59:29 +0100
committerSébastien Crozet <sebastien@crozet.re>2022-03-20 21:49:16 +0100
commit815de4beff2ca31255c7fb937337602eb784ed67 (patch)
tree82b93d1fcad98f9a9a6732e2cc0208f8a44fe67b /src/dynamics/solver/velocity_ground_constraint_wide.rs
parent2e6f133b95b614f13445722e54f28105d9664841 (diff)
downloadrapier-815de4beff2ca31255c7fb937337602eb784ed67.tar.gz
rapier-815de4beff2ca31255c7fb937337602eb784ed67.tar.bz2
rapier-815de4beff2ca31255c7fb937337602eb784ed67.zip
Complete the parallel solver fix
Diffstat (limited to 'src/dynamics/solver/velocity_ground_constraint_wide.rs')
-rw-r--r--src/dynamics/solver/velocity_ground_constraint_wide.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/dynamics/solver/velocity_ground_constraint_wide.rs b/src/dynamics/solver/velocity_ground_constraint_wide.rs
index 9d6deab..908e55f 100644
--- a/src/dynamics/solver/velocity_ground_constraint_wide.rs
+++ b/src/dynamics/solver/velocity_ground_constraint_wide.rs
@@ -35,7 +35,7 @@ impl WVelocityGroundConstraint {
manifolds: [&ContactManifold; SIMD_WIDTH],
bodies: &Bodies,
out_constraints: &mut Vec<AnyVelocityConstraint>,
- push: bool,
+ insert_at: Option<usize>,
) where
Bodies: ComponentSet<RigidBodyIds>
+ ComponentSet<RigidBodyVelocity>
@@ -188,11 +188,11 @@ impl WVelocityGroundConstraint {
}
}
- if push {
- out_constraints.push(AnyVelocityConstraint::GroupedGround(constraint));
- } else {
- out_constraints[manifolds[0].data.constraint_index + l / MAX_MANIFOLD_POINTS] =
+ if let Some(at) = insert_at {
+ out_constraints[at + l / MAX_MANIFOLD_POINTS] =
AnyVelocityConstraint::GroupedGround(constraint);
+ } else {
+ out_constraints.push(AnyVelocityConstraint::GroupedGround(constraint));
}
}
}