btMultiBody: fix indexing issue causing wrong friction to be reported (has no effect, since we don't use warmstarting for multibody)

This commit is contained in:
erwincoumans
2018-10-06 15:25:22 -07:00
parent 8765c0a027
commit 71d4a90c98

View File

@@ -1232,7 +1232,7 @@ void btMultiBodyConstraintSolver::convertMultiBodyContact(btPersistentManifold*
/////setup the friction constraints
#define ENABLE_FRICTION
#ifdef ENABLE_FRICTION
solverConstraint.m_frictionIndex = frictionIndex;
solverConstraint.m_frictionIndex = m_multiBodyFrictionContactConstraints.size();
///Bullet has several options to set the friction directions
///By default, each contact has only a single friction direction that is recomputed automatically every frame
@@ -1501,7 +1501,12 @@ btScalar btMultiBodyConstraintSolver::solveGroupCacheFriendlyFinish(btCollisionO
if ((infoGlobal.m_solverMode & SOLVER_USE_2_FRICTION_DIRECTIONS))
{
pt->m_appliedImpulseLateral2 = m_multiBodyFrictionContactConstraints[solverConstraint.m_frictionIndex + 1].m_appliedImpulse;
} else
{
pt->m_appliedImpulseLateral2 = 0;
}
}
//do a callback here?
}
}