mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 18:19:55 +00:00
fixed the physics debug rendering now activates/deactivates properly
This commit is contained in:
parent
8d7bf34348
commit
a4576f043d
3 changed files with 13 additions and 6 deletions
|
@ -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…
Reference in a new issue