diff options
| author | Sébastien Crozet <developer@crozet.re> | 2022-05-30 19:21:52 +0200 |
|---|---|---|
| committer | Sébastien Crozet <developer@crozet.re> | 2022-05-30 19:21:52 +0200 |
| commit | 31cfce4db30efeb15ccb8c51e6c20ff07406987c (patch) | |
| tree | 17b7b03922db8082ffcc7d402bb71561c29acb44 /src/dynamics/solver | |
| parent | fef84169830186bcde602140541c8e57a7cccc7e (diff) | |
| download | rapier-31cfce4db30efeb15ccb8c51e6c20ff07406987c.tar.gz rapier-31cfce4db30efeb15ccb8c51e6c20ff07406987c.tar.bz2 rapier-31cfce4db30efeb15ccb8c51e6c20ff07406987c.zip | |
Fix wasm build
Diffstat (limited to 'src/dynamics/solver')
| -rw-r--r-- | src/dynamics/solver/velocity_ground_constraint.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/dynamics/solver/velocity_ground_constraint.rs b/src/dynamics/solver/velocity_ground_constraint.rs index e574112..19bf7e6 100644 --- a/src/dynamics/solver/velocity_ground_constraint.rs +++ b/src/dynamics/solver/velocity_ground_constraint.rs @@ -128,6 +128,7 @@ impl VelocityGroundConstraint { constraint.tangent1 = tangents1[0]; } constraint.im2 = mprops2.effective_inv_mass; + constraint.cfm_factor = cfm_factor; constraint.limit = 0.0; constraint.mj_lambda2 = mj_lambda2; constraint.manifold_id = manifold_id; @@ -171,7 +172,7 @@ impl VelocityGroundConstraint { let rhs = rhs_wo_bias + rhs_bias; is_fast_contact = - is_fast_contact || -rhs * params.dt > rb2.ccd.ccd_thickness * 0.5; + is_fast_contact || (-rhs * params.dt > rb2.ccd.ccd_thickness * 0.5); constraint.elements[k].normal_part = VelocityGroundConstraintNormalPart { gcross2, @@ -215,9 +216,7 @@ impl VelocityGroundConstraint { } } - if is_fast_contact { - constraint.cfm_factor = 1.0; - } + constraint.cfm_factor = if is_fast_contact { 1.0 } else { cfm_factor }; #[cfg(not(target_arch = "wasm32"))] if let Some(at) = insert_at { |
