From 46abe231e30f1797ea6da426f8c5d23b3f882fd4 Mon Sep 17 00:00:00 2001 From: Irlan Date: Wed, 12 Jun 2019 20:46:54 -0300 Subject: [PATCH] Use a modified inverse mass to avoid some instability problems --- src/bounce/cloth/cloth_contact_solver.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bounce/cloth/cloth_contact_solver.cpp b/src/bounce/cloth/cloth_contact_solver.cpp index 0a7768c..9154c8a 100644 --- a/src/bounce/cloth/cloth_contact_solver.cpp +++ b/src/bounce/cloth/cloth_contact_solver.cpp @@ -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;