safe guard against NaN in dv after CG solve
This commit is contained in:
@@ -103,6 +103,11 @@ void btDeformableBodySolver::updateVelocity()
|
|||||||
btSoftBody* psb = m_softBodySet[i];
|
btSoftBody* psb = m_softBodySet[i];
|
||||||
for (int j = 0; j < psb->m_nodes.size(); ++j)
|
for (int j = 0; j < psb->m_nodes.size(); ++j)
|
||||||
{
|
{
|
||||||
|
// set NaN to zero;
|
||||||
|
if (m_dv[counter] != m_dv[counter])
|
||||||
|
{
|
||||||
|
m_dv[counter].setZero();
|
||||||
|
}
|
||||||
psb->m_nodes[j].m_v = m_backupVelocity[counter]+m_dv[counter];
|
psb->m_nodes[j].m_v = m_backupVelocity[counter]+m_dv[counter];
|
||||||
++counter;
|
++counter;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user