diff options
| author | Sébastien Crozet <developer@crozet.re> | 2022-05-30 19:14:05 +0200 |
|---|---|---|
| committer | Sébastien Crozet <developer@crozet.re> | 2022-05-30 19:14:05 +0200 |
| commit | fef84169830186bcde602140541c8e57a7cccc7e (patch) | |
| tree | 9a1fde9d80aa2f50b53a2d39d69587804267122d /src/dynamics/solver/velocity_constraint_element.rs | |
| parent | 0d05536ab66052af0dfc153e966c82b4e6d27075 (diff) | |
| download | rapier-fef84169830186bcde602140541c8e57a7cccc7e.tar.gz rapier-fef84169830186bcde602140541c8e57a7cccc7e.tar.bz2 rapier-fef84169830186bcde602140541c8e57a7cccc7e.zip | |
Move the cfm factor to the velocity constraints instead of the elements.
Diffstat (limited to 'src/dynamics/solver/velocity_constraint_element.rs')
| -rw-r--r-- | src/dynamics/solver/velocity_constraint_element.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/dynamics/solver/velocity_constraint_element.rs b/src/dynamics/solver/velocity_constraint_element.rs index 6c1006d..30afef5 100644 --- a/src/dynamics/solver/velocity_constraint_element.rs +++ b/src/dynamics/solver/velocity_constraint_element.rs @@ -112,7 +112,6 @@ pub(crate) struct VelocityConstraintNormalPart<N: WReal> { pub rhs_wo_bias: N, pub impulse: N, pub r: N, - pub cfm: N, } impl<N: WReal> VelocityConstraintNormalPart<N> { @@ -124,7 +123,6 @@ impl<N: WReal> VelocityConstraintNormalPart<N> { rhs_wo_bias: na::zero(), impulse: na::zero(), r: na::zero(), - cfm: na::one(), } } @@ -144,7 +142,7 @@ impl<N: WReal> VelocityConstraintNormalPart<N> { - dir1.dot(&mj_lambda2.linear) + self.gcross2.gdot(mj_lambda2.angular) + self.rhs; - let new_impulse = self.cfm * (self.impulse - self.r * dvel).simd_max(N::zero()); + let new_impulse = cfm_factor * (self.impulse - self.r * dvel).simd_max(N::zero()); let dlambda = new_impulse - self.impulse; self.impulse = new_impulse; |
