fixed the physics debug rendering now activates/deactivates properly

pull/21/head
scrawl 13 years ago
parent 8d7bf34348
commit a4576f043d

@ -27,11 +27,7 @@ bool Debugging::toggleRenderMode (int mode){
switch (mode)
{
case MWWorld::World::Render_CollisionDebug:
// TODO use a proper function instead of accessing the member variable
// directly.
eng->setDebugRenderingMode (!eng->isDebugCreated);
return eng->isDebugCreated;
return eng->toggleDebugRendering();
}
return false;

@ -151,7 +151,8 @@ namespace Physic
PhysicEngine::PhysicEngine(BulletShapeLoader* shapeLoader)
PhysicEngine::PhysicEngine(BulletShapeLoader* shapeLoader) :
mDebugActive(0)
{
// Set up the collision configuration and dispatcher
collisionConfiguration = new btDefaultCollisionConfiguration();
@ -203,6 +204,13 @@ namespace Physic
createDebugRendering();
}
mDebugDrawer->setDebugMode(mode);
mDebugActive = mode;
}
bool PhysicEngine::toggleDebugRendering()
{
setDebugRenderingMode(!mDebugActive);
return mDebugActive;
}
PhysicEngine::~PhysicEngine()

@ -199,6 +199,8 @@ namespace Physic
*/
void setDebugRenderingMode(int mode);
bool toggleDebugRendering();
/**
* Return the closest object hit by a ray. If there are no objects, it will return ("",-1).
*/
@ -230,6 +232,7 @@ namespace Physic
//debug rendering
BtOgre::DebugDrawer* mDebugDrawer;
bool isDebugCreated;
bool mDebugActive;
};
}}

Loading…
Cancel
Save