solvers: remove erroneous 'break' statement that can occur with incorrectly flagged objects; also added asserts to warn when incorrectly flagged objects are detected
This commit is contained in:
@@ -780,6 +780,8 @@ int btSequentialImpulseConstraintSolver::getOrInitSolverBody(btCollisionObject&
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// Incorrectly set collision object flags can degrade performance in various ways.
|
||||||
|
btAssert( body.isStaticOrKinematicObject() );
|
||||||
// all fixed bodies (inf mass) get mapped to a single solver id
|
// all fixed bodies (inf mass) get mapped to a single solver id
|
||||||
if ( m_fixedBodyId < 0 )
|
if ( m_fixedBodyId < 0 )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -422,9 +422,10 @@ void btSequentialImpulseConstraintSolverMt::internalCollectContactManifoldCached
|
|||||||
btSolverBody* solverBodyA = &m_tmpSolverBodyPool[ solverBodyIdA ];
|
btSolverBody* solverBodyA = &m_tmpSolverBodyPool[ solverBodyIdA ];
|
||||||
btSolverBody* solverBodyB = &m_tmpSolverBodyPool[ solverBodyIdB ];
|
btSolverBody* solverBodyB = &m_tmpSolverBodyPool[ solverBodyIdB ];
|
||||||
|
|
||||||
///avoid collision response between two static objects
|
// A contact manifold between 2 static object should not exist!
|
||||||
if ( solverBodyA->m_invMass.fuzzyZero() && solverBodyB->m_invMass.fuzzyZero() )
|
// check the collision flags of your objects if this assert fires.
|
||||||
break;
|
// Incorrectly set collision object flags can degrade performance in various ways.
|
||||||
|
btAssert( !m_tmpSolverBodyPool[ solverBodyIdA ].m_invMass.isZero() || !m_tmpSolverBodyPool[ solverBodyIdB ].m_invMass.isZero() );
|
||||||
|
|
||||||
int iContact = 0;
|
int iContact = 0;
|
||||||
for ( int j = 0; j < manifold->getNumContacts(); j++ )
|
for ( int j = 0; j < manifold->getNumContacts(); j++ )
|
||||||
|
|||||||
Reference in New Issue
Block a user