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_ground_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_ground_constraint_element.rs')
| -rw-r--r-- | src/dynamics/solver/velocity_ground_constraint_element.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/dynamics/solver/velocity_ground_constraint_element.rs b/src/dynamics/solver/velocity_ground_constraint_element.rs index 3b2ed86..06a727a 100644 --- a/src/dynamics/solver/velocity_ground_constraint_element.rs +++ b/src/dynamics/solver/velocity_ground_constraint_element.rs @@ -93,7 +93,6 @@ pub(crate) struct VelocityGroundConstraintNormalPart<N: WReal> { pub rhs_wo_bias: N, pub impulse: N, pub r: N, - pub cfm: N, } impl<N: WReal> VelocityGroundConstraintNormalPart<N> { @@ -104,7 +103,6 @@ impl<N: WReal> VelocityGroundConstraintNormalPart<N> { rhs_wo_bias: na::zero(), impulse: na::zero(), r: na::zero(), - cfm: na::one(), } } @@ -119,7 +117,7 @@ impl<N: WReal> VelocityGroundConstraintNormalPart<N> { AngVector<N>: WDot<AngVector<N>, Result = N>, { let dvel = -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; |
