Fix compilation of parallel version

This commit is contained in:
Sébastien Crozet
2022-01-23 17:06:42 +01:00
parent 9bfcde25e0
commit 5e2111bdb1
2 changed files with 40 additions and 5 deletions

36
.vscode/tasks.json vendored
View File

@@ -29,9 +29,23 @@
"all_examples3",
"--release",
"--features",
"simd-stable",
"simd-stable,other-backends",
"--",
"--pause"
],
"group": "build"
},
{
"label": "run 3d (simd - parallel - release) ",
"type": "shell",
"command": "cargo",
"args": [
"run",
"--bin",
"all_examples3",
"--release",
"--features",
"other-backends",
"simd-stable,other-backends,parallel",
"--",
"--pause"
],
@@ -63,9 +77,23 @@
"all_examples2",
"--release",
"--features",
"simd-stable",
"simd-stable,other-backends",
"--",
"--pause"
],
"group": "build"
},
{
"label": "run 2d (simd - parallel - release) ",
"type": "shell",
"command": "cargo",
"args": [
"run",
"--bin",
"all_examples2",
"--release",
"--features",
"other-backends",
"simd-stable,other-backends,parallel",
"--",
"--pause"
],

View File

@@ -54,6 +54,7 @@ impl ParallelVelocitySolver {
let joint_descs = &joint_constraints.constraint_descs[..];
let mut target_num_desc = 0;
let mut shift = 0;
let cfm_factor = params.cfm_factor();
for _ in 0..params.max_velocity_iterations {
macro_rules! solve {
@@ -116,7 +117,13 @@ impl ParallelVelocitySolver {
);
shift += joint_descs.len();
start_index -= joint_descs.len();
solve!(contact_constraints, &mut self.mj_lambdas, true, true);
solve!(
contact_constraints,
cfm_factor,
&mut self.mj_lambdas,
true,
true
);
shift += contact_descs.len();
start_index -= contact_descs.len();
}