mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 22:23:51 +00:00
Dead code removal
This commit is contained in:
parent
cac288d5be
commit
bddd31e385
3 changed files with 4 additions and 88 deletions
|
@ -503,14 +503,14 @@ namespace MWWorld
|
||||||
{
|
{
|
||||||
// Create physics. shapeLoader is deleted by the physic engine
|
// Create physics. shapeLoader is deleted by the physic engine
|
||||||
//NifBullet::ManualBulletShapeLoader* shapeLoader = new NifBullet::ManualBulletShapeLoader();
|
//NifBullet::ManualBulletShapeLoader* shapeLoader = new NifBullet::ManualBulletShapeLoader();
|
||||||
//mEngine = new OEngine::Physic::PhysicEngine(0);//shapeLoader);
|
mEngine = new OEngine::Physic::PhysicEngine(0);//shapeLoader);
|
||||||
}
|
}
|
||||||
|
|
||||||
PhysicsSystem::~PhysicsSystem()
|
PhysicsSystem::~PhysicsSystem()
|
||||||
{
|
{
|
||||||
//if (mWaterCollisionObject.get())
|
if (mWaterCollisionObject.get())
|
||||||
// mEngine->mDynamicsWorld->removeCollisionObject(mWaterCollisionObject.get());
|
mEngine->mDynamicsWorld->removeCollisionObject(mWaterCollisionObject.get());
|
||||||
//delete mEngine;
|
delete mEngine;
|
||||||
//delete OEngine::Physic::BulletShapeManager::getSingletonPtr();
|
//delete OEngine::Physic::BulletShapeManager::getSingletonPtr();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -262,10 +262,6 @@ namespace Physic
|
||||||
|
|
||||||
mDynamicsWorld->setGravity(btVector3(0,0,-10));
|
mDynamicsWorld->setGravity(btVector3(0,0,-10));
|
||||||
|
|
||||||
if(BulletShapeManager::getSingletonPtr() == NULL)
|
|
||||||
{
|
|
||||||
new BulletShapeManager();
|
|
||||||
}
|
|
||||||
mShapeLoader = shapeLoader;
|
mShapeLoader = shapeLoader;
|
||||||
|
|
||||||
isDebugCreated = false;
|
isDebugCreated = false;
|
||||||
|
@ -763,76 +759,5 @@ namespace Physic
|
||||||
return std::make_pair(false, 1.0f);
|
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 isDebugCreated;
|
||||||
bool mDebugActive;
|
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:
|
private:
|
||||||
PhysicEngine(const PhysicEngine&);
|
PhysicEngine(const PhysicEngine&);
|
||||||
PhysicEngine& operator=(const PhysicEngine&);
|
PhysicEngine& operator=(const PhysicEngine&);
|
||||||
|
|
Loading…
Reference in a new issue