Dead code removal

c++11
scrawl 10 years ago
parent cac288d5be
commit bddd31e385

@ -503,14 +503,14 @@ namespace MWWorld
{
// Create physics. shapeLoader is deleted by the physic engine
//NifBullet::ManualBulletShapeLoader* shapeLoader = new NifBullet::ManualBulletShapeLoader();
//mEngine = new OEngine::Physic::PhysicEngine(0);//shapeLoader);
mEngine = new OEngine::Physic::PhysicEngine(0);//shapeLoader);
}
PhysicsSystem::~PhysicsSystem()
{
//if (mWaterCollisionObject.get())
// mEngine->mDynamicsWorld->removeCollisionObject(mWaterCollisionObject.get());
//delete mEngine;
if (mWaterCollisionObject.get())
mEngine->mDynamicsWorld->removeCollisionObject(mWaterCollisionObject.get());
delete mEngine;
//delete OEngine::Physic::BulletShapeManager::getSingletonPtr();
}

@ -262,10 +262,6 @@ namespace Physic
mDynamicsWorld->setGravity(btVector3(0,0,-10));
if(BulletShapeManager::getSingletonPtr() == NULL)
{
new BulletShapeManager();
}
mShapeLoader = shapeLoader;
isDebugCreated = false;
@ -763,76 +759,5 @@ namespace Physic
return std::make_pair(false, 1.0f);
}
int PhysicEngine::toggleDebugRendering(Ogre::SceneManager *sceneMgr)
{
if(!sceneMgr)
return 0;
std::map<Ogre::SceneManager *, BtOgre::DebugDrawer *>::iterator iter =
mDebugDrawers.find(sceneMgr);
if(iter != mDebugDrawers.end()) // found scene manager
{
if((*iter).second)
{
// set a new drawer each time (maybe with a different scene manager)
mDynamicsWorld->setDebugDrawer(mDebugDrawers[sceneMgr]);
if(!mDebugDrawers[sceneMgr]->getDebugMode())
mDebugDrawers[sceneMgr]->setDebugMode(1 /*mDebugDrawFlags*/);
else
mDebugDrawers[sceneMgr]->setDebugMode(0);
mDynamicsWorld->debugDrawWorld();
return mDebugDrawers[sceneMgr]->getDebugMode();
}
}
return 0;
}
void PhysicEngine::stepDebug(Ogre::SceneManager *sceneMgr)
{
if(!sceneMgr)
return;
std::map<Ogre::SceneManager *, BtOgre::DebugDrawer *>::iterator iter =
mDebugDrawers.find(sceneMgr);
if(iter != mDebugDrawers.end()) // found scene manager
{
if((*iter).second)
(*iter).second->step();
else
return;
}
}
void PhysicEngine::createDebugDraw(Ogre::SceneManager *sceneMgr)
{
if(mDebugDrawers.find(sceneMgr) == mDebugDrawers.end())
{
mDebugSceneNodes[sceneMgr] = sceneMgr->getRootSceneNode()->createChildSceneNode();
mDebugDrawers[sceneMgr] = new BtOgre::DebugDrawer(mDebugSceneNodes[sceneMgr], mDynamicsWorld);
mDebugDrawers[sceneMgr]->setDebugMode(0);
}
}
void PhysicEngine::removeDebugDraw(Ogre::SceneManager *sceneMgr)
{
std::map<Ogre::SceneManager *, BtOgre::DebugDrawer *>::iterator iter =
mDebugDrawers.find(sceneMgr);
if(iter != mDebugDrawers.end())
{
delete (*iter).second;
mDebugDrawers.erase(iter);
}
std::map<Ogre::SceneManager *, Ogre::SceneNode *>::iterator it =
mDebugSceneNodes.find(sceneMgr);
if(it != mDebugSceneNodes.end())
{
std::string sceneNodeName = (*it).second->getName();
if(sceneMgr->hasSceneNode(sceneNodeName))
sceneMgr->destroySceneNode(sceneNodeName);
}
}
}
}

@ -335,15 +335,6 @@ namespace Physic
bool isDebugCreated;
bool mDebugActive;
// for OpenCS with multiple engines per document
std::map<Ogre::SceneManager *, BtOgre::DebugDrawer *> mDebugDrawers;
std::map<Ogre::SceneManager *, Ogre::SceneNode *> mDebugSceneNodes;
int toggleDebugRendering(Ogre::SceneManager *sceneMgr);
void stepDebug(Ogre::SceneManager *sceneMgr);
void createDebugDraw(Ogre::SceneManager *sceneMgr);
void removeDebugDraw(Ogre::SceneManager *sceneMgr);
private:
PhysicEngine(const PhysicEngine&);
PhysicEngine& operator=(const PhysicEngine&);

Loading…
Cancel
Save