diff options
| author | Sébastien Crozet <developer@crozet.re> | 2022-01-23 16:50:02 +0100 |
|---|---|---|
| committer | Sébastien Crozet <developer@crozet.re> | 2022-01-23 16:50:26 +0100 |
| commit | 78c8bc6cdef26d14c57d0eeb23188cba592961bf (patch) | |
| tree | b26951b1b08c66171e172237dfce6024792b36e9 /src/dynamics/solver/generic_velocity_constraint.rs | |
| parent | b7bf80550d8cc61637a251aa2ba0e6cdb8d26b74 (diff) | |
| download | rapier-78c8bc6cdef26d14c57d0eeb23188cba592961bf.tar.gz rapier-78c8bc6cdef26d14c57d0eeb23188cba592961bf.tar.bz2 rapier-78c8bc6cdef26d14c57d0eeb23188cba592961bf.zip | |
Improve cfm configuration using the critical damping factor
Diffstat (limited to 'src/dynamics/solver/generic_velocity_constraint.rs')
| -rw-r--r-- | src/dynamics/solver/generic_velocity_constraint.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/dynamics/solver/generic_velocity_constraint.rs b/src/dynamics/solver/generic_velocity_constraint.rs index f1ab0ea..c1d4134 100644 --- a/src/dynamics/solver/generic_velocity_constraint.rs +++ b/src/dynamics/solver/generic_velocity_constraint.rs @@ -23,6 +23,7 @@ pub(crate) enum AnyGenericVelocityConstraint { impl AnyGenericVelocityConstraint { pub fn solve( &mut self, + cfm_factor: Real, jacobians: &DVector<Real>, mj_lambdas: &mut [DeltaVel<Real>], generic_mj_lambdas: &mut DVector<Real>, @@ -31,6 +32,7 @@ impl AnyGenericVelocityConstraint { ) { match self { AnyGenericVelocityConstraint::Nongrouped(c) => c.solve( + cfm_factor, jacobians, mj_lambdas, generic_mj_lambdas, @@ -38,6 +40,7 @@ impl AnyGenericVelocityConstraint { solve_friction, ), AnyGenericVelocityConstraint::NongroupedGround(c) => c.solve( + cfm_factor, jacobians, generic_mj_lambdas, solve_restitution, @@ -379,6 +382,7 @@ impl GenericVelocityConstraint { pub fn solve( &mut self, + cfm_factor: Real, jacobians: &DVector<Real>, mj_lambdas: &mut [DeltaVel<Real>], generic_mj_lambdas: &mut DVector<Real>, @@ -400,6 +404,7 @@ impl GenericVelocityConstraint { let elements = &mut self.velocity_constraint.elements [..self.velocity_constraint.num_contacts as usize]; VelocityConstraintElement::generic_solve_group( + cfm_factor, elements, jacobians, &self.velocity_constraint.dir1, |
