Use a modified inverse mass to avoid some instability problems

This commit is contained in:
Irlan 2019-06-12 20:46:54 -03:00
parent e5db997fa7
commit 46abe231e3

View File

@ -675,7 +675,8 @@ bool b3ClothContactSolver::SolveTriangleContactPositionConstraints()
b3Vec3 JD = b3Cross(xC - xB, N_n);
// Compute effective mass.
float32 K = mA + mB * b3Dot(JB, JB) + mC * b3Dot(JC, JC) + mD * b3Dot(JD, JD);
//float32 K = mA + mB * b3Dot(JB, JB) + mC * b3Dot(JC, JC) + mD * b3Dot(JD, JD);
float32 K = mA + mB + mC + mD;
// Compute normal impulse.
float32 impulse = K > 0.0f ? -C / K : 0.0f;