disable constraints when they exceed a breaking threshold, control it with new methods in btTypedConstraint: get/setBreakingImpulseThreshold and get/setEnabled

Disabled constraints are not removed from the world and they use negligible CPU cycles
This commit is contained in:
erwin.coumans
2011-04-02 19:01:23 +00:00
parent d198451909
commit b16b61d9d6
6 changed files with 91 additions and 42 deletions

View File

@@ -1345,6 +1345,11 @@ void DemoApplication::clientResetScene()
if (m_dynamicsWorld)
{
int numConstraints = m_dynamicsWorld->getNumConstraints();
for (i=0;i<numConstraints;i++)
{
m_dynamicsWorld->getConstraint(0)->setEnabled(true);
}
numObjects = m_dynamicsWorld->getNumCollisionObjects();
///create a copy of the array, not a reference!