diff --git a/src/BulletSoftBody/btDeformableBodySolver.cpp b/src/BulletSoftBody/btDeformableBodySolver.cpp index 618bf7ed5..676df528d 100644 --- a/src/BulletSoftBody/btDeformableBodySolver.cpp +++ b/src/BulletSoftBody/btDeformableBodySolver.cpp @@ -376,8 +376,8 @@ void btDeformableBodySolver::predictDeformableMotion(btSoftBody* psb, btScalar d psb->updateBounds(); /* Integrate */ - // do not allow particles to move more than 10% of the bounding box size - btScalar max_v = 0.1 * (psb->m_bounds[1]-psb->m_bounds[0]).norm() / dt; + // do not allow particles to move more than the bounding box size + btScalar max_v = (psb->m_bounds[1]-psb->m_bounds[0]).norm() / dt; for (i = 0, ni = psb->m_nodes.size(); i < ni; ++i) { btSoftBody::Node& n = psb->m_nodes[i]; diff --git a/src/BulletSoftBody/btDeformableNeoHookeanForce.h b/src/BulletSoftBody/btDeformableNeoHookeanForce.h index 797addf8b..816d214ef 100644 --- a/src/BulletSoftBody/btDeformableNeoHookeanForce.h +++ b/src/BulletSoftBody/btDeformableNeoHookeanForce.h @@ -73,7 +73,10 @@ public: size_t id3 = node3->index; btMatrix3x3 dF = DsFromVelocity(node0, node1, node2, node3) * tetra.m_Dm_inverse; btMatrix3x3 dP; - firstPiolaDampingDifferential(psb->m_tetraScratchesTn[j], dF, dP); +// firstPiolaDampingDifferential(psb->m_tetraScratchesTn[j], dF, dP); + btMatrix3x3 I; + I.setIdentity(); + dP = (dF + dF.transpose()) * m_mu_damp + I * (dF[0][0]+dF[1][1]+dF[2][2]) * m_lambda_damp; btVector3 df_on_node0 = dP * (tetra.m_Dm_inverse.transpose()*grad_N_hat_1st_col); btMatrix3x3 df_on_node123 = dP * tetra.m_Dm_inverse.transpose(); @@ -210,7 +213,10 @@ public: size_t id3 = node3->index; btMatrix3x3 dF = Ds(id0, id1, id2, id3, dv) * tetra.m_Dm_inverse; btMatrix3x3 dP; - firstPiolaDampingDifferential(psb->m_tetraScratchesTn[j], dF, dP); +// firstPiolaDampingDifferential(psb->m_tetraScratchesTn[j], dF, dP); + btMatrix3x3 I; + I.setIdentity(); + dP = (dF + dF.transpose()) * m_mu_damp + I * (dF[0][0]+dF[1][1]+dF[2][2]) * m_lambda_damp; // btVector3 df_on_node0 = dP * (tetra.m_Dm_inverse.transpose()*grad_N_hat_1st_col); btMatrix3x3 df_on_node123 = dP * tetra.m_Dm_inverse.transpose(); btVector3 df_on_node0 = df_on_node123 * grad_N_hat_1st_col;