confusion about memory management, and removed obsolete PhysicsInterface code.todo: updated the demos that still use this code

This commit is contained in:
ejcoumans
2006-09-29 19:57:23 +00:00
parent 0d7c960eb6
commit 14397a2f72
39 changed files with 74 additions and 5700 deletions

View File

@@ -23,15 +23,15 @@ subject to the following restrictions:
btSimpleDynamicsWorld::btSimpleDynamicsWorld()
:btDynamicsWorld(new btCollisionDispatcher(),new btSimpleBroadphase()),
m_constraintSolver(new btSequentialImpulseConstraintSolver)
:m_constraintSolver(new btSequentialImpulseConstraintSolver),
m_ownsConstraintSolver(true)
{
}
btSimpleDynamicsWorld::btSimpleDynamicsWorld(btDispatcher* dispatcher,btOverlappingPairCache* pairCache,btConstraintSolver* constraintSolver)
:btDynamicsWorld(dispatcher,pairCache),
m_constraintSolver(constraintSolver)
m_constraintSolver(constraintSolver),
m_ownsConstraintSolver(false)
{
}
@@ -39,13 +39,8 @@ m_constraintSolver(constraintSolver)
btSimpleDynamicsWorld::~btSimpleDynamicsWorld()
{
delete m_constraintSolver;
//delete the dispatcher and paircache
delete m_dispatcher1;
m_dispatcher1 = 0;
delete m_pairCache;
m_pairCache = 0;
if (m_ownsConstraintSolver)
delete m_constraintSolver;
}
void btSimpleDynamicsWorld::stepSimulation(float timeStep)
@@ -86,7 +81,7 @@ void btSimpleDynamicsWorld::updateAabbs()
{
btPoint3 minAabb,maxAabb;
colObj->m_collisionShape->getAabb(colObj->m_worldTransform, minAabb,maxAabb);
btSimpleBroadphase* bp = (btSimpleBroadphase*)m_pairCache;
btBroadphaseInterface* bp = getBroadphase();
bp->setAabb(body->m_broadphaseHandle,minAabb,maxAabb);
}
}