Fix issue in the contact solver that reduces jittering

This commit is contained in:
Daniel Chappuis 2013-09-03 19:31:50 +02:00
parent 8db7823433
commit a009debf21

View File

@ -266,10 +266,10 @@ void ContactSolver::initializeContactConstraints() {
// Compute the restitution velocity bias "b". We compute this here instead
// of inside the solve() method because we need to use the velocity difference
// at the beginning of the contact. Note that if it is a resting contact (normal
// velocity under a given threshold), we don't add a restitution velocity bias
// velocity bellow a given threshold), we do not add a restitution velocity bias
contactPoint.restitutionBias = 0.0;
decimal deltaVDotN = deltaV.dot(contactPoint.normal);
if (deltaVDotN < RESTITUTION_VELOCITY_THRESHOLD) {
if (deltaVDotN < -RESTITUTION_VELOCITY_THRESHOLD) {
contactPoint.restitutionBias = manifold.restitutionFactor * deltaVDotN;
}