combat friction drift in positionCorrect by changing velocity and change it back (effectively only changing position)
This commit is contained in:
@@ -29,6 +29,7 @@ void btDeformableBodySolver::solveConstraints(float solverdt)
|
||||
|
||||
// save v_{n+1}^* velocity after explicit forces
|
||||
backupVelocity();
|
||||
|
||||
m_objective->computeResidual(solverdt, m_residual);
|
||||
// m_objective->initialGuess(m_dv, m_residual);
|
||||
computeStep(m_dv, m_residual);
|
||||
@@ -98,6 +99,20 @@ void btDeformableBodySolver::backupVelocity()
|
||||
}
|
||||
}
|
||||
|
||||
void btDeformableBodySolver::revertVelocity()
|
||||
{
|
||||
// serial implementation
|
||||
int counter = 0;
|
||||
for (int i = 0; i < m_softBodySet.size(); ++i)
|
||||
{
|
||||
btSoftBody* psb = m_softBodySet[i];
|
||||
for (int j = 0; j < psb->m_nodes.size(); ++j)
|
||||
{
|
||||
psb->m_nodes[j].m_v = m_backupVelocity[counter++];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool btDeformableBodySolver::updateNodes()
|
||||
{
|
||||
int numNodes = 0;
|
||||
|
||||
Reference in New Issue
Block a user