mirror of
https://github.com/bulletphysics/bullet3.git
synced 2026-10-18 06:45:40 +00:00
fix bug in deformable replulsion force and adjust parameter in deformable self collision
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user