set m_contact_iterations to solverInfo.m_solverIterations
This commit is contained in:
@@ -21,7 +21,6 @@
|
|||||||
btDeformableBodySolver::btDeformableBodySolver()
|
btDeformableBodySolver::btDeformableBodySolver()
|
||||||
: m_numNodes(0)
|
: m_numNodes(0)
|
||||||
, m_cg(50)
|
, m_cg(50)
|
||||||
, m_contact_iterations(5)
|
|
||||||
{
|
{
|
||||||
m_objective = new btDeformableBackwardEulerObjective(m_softBodySet, m_backupVelocity);
|
m_objective = new btDeformableBackwardEulerObjective(m_softBodySet, m_backupVelocity);
|
||||||
}
|
}
|
||||||
@@ -79,12 +78,16 @@ void btDeformableBodySolver::setConstraints()
|
|||||||
{
|
{
|
||||||
BT_PROFILE("setConstraint");
|
BT_PROFILE("setConstraint");
|
||||||
m_objective->setConstraints();
|
m_objective->setConstraints();
|
||||||
|
// m_contact_iterations takes over m_numIterations
|
||||||
|
m_contact_iterations = m_objective->m_world->getSolverInfo().m_numIterations;
|
||||||
for (int i = 0; i < m_contact_iterations; ++i)
|
for (int i = 0; i < m_contact_iterations; ++i)
|
||||||
{
|
{
|
||||||
m_objective->projection.update();
|
m_objective->projection.update();
|
||||||
m_objective->enforceConstraint(m_dv);
|
m_objective->enforceConstraint(m_dv);
|
||||||
m_objective->updateVelocity(m_dv);
|
m_objective->updateVelocity(m_dv);
|
||||||
}
|
}
|
||||||
|
// recover m_numIterations from m_contact_iterations
|
||||||
|
m_objective->m_world->getSolverInfo().m_numIterations = m_contact_iterations;
|
||||||
}
|
}
|
||||||
|
|
||||||
void btDeformableBodySolver::setWorld(btDeformableMultiBodyDynamicsWorld* world)
|
void btDeformableBodySolver::setWorld(btDeformableMultiBodyDynamicsWorld* world)
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ void btDeformableContactProjection::update()
|
|||||||
{
|
{
|
||||||
///solve rigid body constraints
|
///solve rigid body constraints
|
||||||
{
|
{
|
||||||
|
// m_numIterations get temporarily to 1 so that we interleave one step of multibody solve with one step of multibody/deformable contact solve
|
||||||
m_world->getSolverInfo().m_numIterations = 1;
|
m_world->getSolverInfo().m_numIterations = 1;
|
||||||
m_world->processIslands();
|
m_world->processIslands();
|
||||||
m_world->btMultiBodyDynamicsWorld::solveInternalConstraints(m_world->getSolverInfo()); // process constraints deferred in the previous step
|
m_world->btMultiBodyDynamicsWorld::solveInternalConstraints(m_world->getSolverInfo()); // process constraints deferred in the previous step
|
||||||
|
|||||||
Reference in New Issue
Block a user