fix bug in deformable replulsion force and adjust parameter in deformable self collision

This commit is contained in:
Xuchen Han
2020-06-26 11:49:23 -07:00
parent 4317ddc285
commit 70a0ef65d8
3 changed files with 8 additions and 5 deletions

View File

@@ -290,6 +290,7 @@ btScalar btDeformableRigidContactConstraint::solveConstraint(const btContactSolv
if (m_total_normal_dv.dot(cti.m_normal) < 0)
{
// separating in the normal direction
m_binding = false;
m_static = false;
impulse_tangent.setZero();
}

View File

@@ -1328,7 +1328,7 @@ public:
int face_penetration = 0, node_penetration = node->m_constrained;
for (int i = 0; i < 3; ++i)
face_penetration |= face->m_n[i]->m_constrained;
btScalar I_tilde = .5 * I / (1.0 + w.length2());
btScalar I_tilde = 2.0 * I / (1.0 + w.length2());
// double the impulse if node or face is constrained.
if (face_penetration > 0 || node_penetration > 0)
@@ -1354,10 +1354,10 @@ public:
btScalar vt_new = btMax(btScalar(1) - mu * delta_vn / (vt_norm + SIMD_EPSILON), btScalar(0)) * vt_norm;
I = 0.5 * mass * (vt_norm - vt_new);
vt.safeNormalize();
I_tilde = .5 * I / (1.0 + w.length2());
I_tilde = 2.0 * I / (1.0 + w.length2());
// double the impulse if node or face is constrained.
// if (face_penetration > 0 || node_penetration > 0)
// I_tilde *= 2.0;
if (face_penetration > 0 || node_penetration > 0)
I_tilde *= 2.0;
if (face_penetration <= 0)
{
for (int j = 0; j < 3; ++j)