Fix issue in the contact solver that reduces jittering
This commit is contained in:
parent
8db7823433
commit
a009debf21
|
@ -266,10 +266,10 @@ void ContactSolver::initializeContactConstraints() {
|
||||||
// Compute the restitution velocity bias "b". We compute this here instead
|
// Compute the restitution velocity bias "b". We compute this here instead
|
||||||
// of inside the solve() method because we need to use the velocity difference
|
// 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
|
// 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;
|
contactPoint.restitutionBias = 0.0;
|
||||||
decimal deltaVDotN = deltaV.dot(contactPoint.normal);
|
decimal deltaVDotN = deltaV.dot(contactPoint.normal);
|
||||||
if (deltaVDotN < RESTITUTION_VELOCITY_THRESHOLD) {
|
if (deltaVDotN < -RESTITUTION_VELOCITY_THRESHOLD) {
|
||||||
contactPoint.restitutionBias = manifold.restitutionFactor * deltaVDotN;
|
contactPoint.restitutionBias = manifold.restitutionFactor * deltaVDotN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user