build islands once and process islands arbitrary number of times in update constraints
This commit is contained in:
@@ -143,6 +143,8 @@ void btDeformableBackwardEulerObjective::setConstraints()
|
||||
{
|
||||
// build islands for multibody solve
|
||||
m_world->btMultiBodyDynamicsWorld::buildIslands();
|
||||
// for repeated constraint solve, splitIslands has to be set to true
|
||||
m_world->setSplitIslands(true);
|
||||
projection.setConstraints();
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
btDeformableBodySolver::btDeformableBodySolver()
|
||||
: m_numNodes(0)
|
||||
, m_cg(10)
|
||||
, m_contact_iterations(10)
|
||||
, m_contact_iterations(5)
|
||||
{
|
||||
m_objective = new btDeformableBackwardEulerObjective(m_softBodySet, m_backupVelocity);
|
||||
}
|
||||
|
||||
@@ -51,9 +51,11 @@ static btVector3 generateUnitOrthogonalVector(const btVector3& u)
|
||||
void btDeformableContactProjection::update()
|
||||
{
|
||||
///solve rigid body constraints
|
||||
m_world->getSolverInfo().m_numIterations = 1;
|
||||
m_world->btMultiBodyDynamicsWorld::solveInternalConstraints(m_world->getSolverInfo());
|
||||
|
||||
{
|
||||
m_world->getSolverInfo().m_numIterations = 1;
|
||||
m_world->processIslands();
|
||||
m_world->btMultiBodyDynamicsWorld::solveInternalConstraints(m_world->getSolverInfo()); // process constraints deferred in the previous step
|
||||
}
|
||||
// loop through constraints to set constrained values
|
||||
for (int index = 0; index < m_constraints.size(); ++index)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user