optimization: only call solveGroup if there is some work: avoid virtual function call, its overhead can be excessive
based on 3000 body benchmark
This commit is contained in:
@@ -595,7 +595,11 @@ void btDiscreteDynamicsWorld::solveConstraints(btContactSolverInfo& solverInfo)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///only call solveGroup if there is some work: avoid virtual function call, its overhead can be excessive
|
||||||
|
if (numManifolds + numCurConstraints)
|
||||||
|
{
|
||||||
m_solver->solveGroup( bodies,numBodies,manifolds, numManifolds,startConstraint,numCurConstraints,m_solverInfo,m_debugDrawer,m_stackAlloc,m_dispatcher);
|
m_solver->solveGroup( bodies,numBodies,manifolds, numManifolds,startConstraint,numCurConstraints,m_solverInfo,m_debugDrawer,m_stackAlloc,m_dispatcher);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user