mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-20 02:23:53 +00:00
Removing some leftovers of mwRoot node
This commit is contained in:
parent
341f9b96e2
commit
cc9b72b9b1
10 changed files with 35 additions and 43 deletions
|
@ -28,8 +28,8 @@ Actors::~Actors()
|
|||
}
|
||||
}
|
||||
|
||||
void Actors::setMwRoot(Ogre::SceneNode* root)
|
||||
{ mMwRoot = root; }
|
||||
void Actors::setRootNode(Ogre::SceneNode* root)
|
||||
{ mRootNode = root; }
|
||||
|
||||
void Actors::insertBegin(const MWWorld::Ptr &ptr)
|
||||
{
|
||||
|
@ -40,7 +40,7 @@ void Actors::insertBegin(const MWWorld::Ptr &ptr)
|
|||
else
|
||||
{
|
||||
//Create the scenenode and put it in the map
|
||||
cellnode = mMwRoot->createChildSceneNode();
|
||||
cellnode = mRootNode->createChildSceneNode();
|
||||
mCellSceneNodes[ptr.getCell()] = cellnode;
|
||||
}
|
||||
|
||||
|
@ -159,7 +159,7 @@ void Actors::updateObjectCell(const MWWorld::Ptr &old, const MWWorld::Ptr &cur)
|
|||
node = celliter->second;
|
||||
else
|
||||
{
|
||||
node = mMwRoot->createChildSceneNode();
|
||||
node = mRootNode->createChildSceneNode();
|
||||
mCellSceneNodes[newCell] = node;
|
||||
}
|
||||
node->addChild(cur.getRefData().getBaseNode());
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace MWRender
|
|||
typedef std::map<MWWorld::Ptr,Animation*> PtrAnimationMap;
|
||||
|
||||
OEngine::Render::OgreRenderer &mRend;
|
||||
Ogre::SceneNode* mMwRoot;
|
||||
Ogre::SceneNode* mRootNode;
|
||||
|
||||
CellSceneNodeMap mCellSceneNodes;
|
||||
PtrAnimationMap mAllActors;
|
||||
|
@ -29,7 +29,7 @@ namespace MWRender
|
|||
Actors(OEngine::Render::OgreRenderer& _rend): mRend(_rend) {}
|
||||
~Actors();
|
||||
|
||||
void setMwRoot(Ogre::SceneNode* root);
|
||||
void setRootNode(Ogre::SceneNode* root);
|
||||
void insertBegin (const MWWorld::Ptr& ptr);
|
||||
void insertNPC(const MWWorld::Ptr& ptr, MWWorld::InventoryStore& inv);
|
||||
void insertCreature (const MWWorld::Ptr& ptr);
|
||||
|
|
|
@ -150,9 +150,9 @@ ManualObject *Debugging::createPathgridPoints(const ESM::Pathgrid *pathgrid)
|
|||
return result;
|
||||
}
|
||||
|
||||
Debugging::Debugging(SceneNode *mwRoot, OEngine::Physic::PhysicEngine *engine) :
|
||||
mMwRoot(mwRoot), mEngine(engine),
|
||||
mSceneMgr(mwRoot->getCreator()),
|
||||
Debugging::Debugging(SceneNode *root, OEngine::Physic::PhysicEngine *engine) :
|
||||
mRootNode(root), mEngine(engine),
|
||||
mSceneMgr(root->getCreator()),
|
||||
mPathgridEnabled(false),
|
||||
mInteriorPathgridNode(NULL), mPathGridRoot(NULL),
|
||||
mGridMatsCreated(false)
|
||||
|
@ -208,7 +208,7 @@ void Debugging::togglePathgrid()
|
|||
createGridMaterials();
|
||||
|
||||
// add path grid meshes to already loaded cells
|
||||
mPathGridRoot = mMwRoot->createChildSceneNode();
|
||||
mPathGridRoot = mRootNode->createChildSceneNode();
|
||||
for(CellList::iterator it = mActiveCells.begin(); it != mActiveCells.end(); ++it)
|
||||
{
|
||||
enableCellPathgrid(*it);
|
||||
|
|
|
@ -54,7 +54,7 @@ namespace MWRender
|
|||
typedef std::vector<MWWorld::CellStore *> CellList;
|
||||
CellList mActiveCells;
|
||||
|
||||
Ogre::SceneNode *mMwRoot;
|
||||
Ogre::SceneNode *mRootNode;
|
||||
|
||||
Ogre::SceneNode *mPathGridRoot;
|
||||
|
||||
|
@ -78,7 +78,7 @@ namespace MWRender
|
|||
Ogre::ManualObject *createPathgridLines(const ESM::Pathgrid *pathgrid);
|
||||
Ogre::ManualObject *createPathgridPoints(const ESM::Pathgrid *pathgrid);
|
||||
public:
|
||||
Debugging(Ogre::SceneNode* mwRoot, OEngine::Physic::PhysicEngine *engine);
|
||||
Debugging(Ogre::SceneNode* root, OEngine::Physic::PhysicEngine *engine);
|
||||
~Debugging();
|
||||
bool toggleRenderMode (int mode);
|
||||
|
||||
|
|
|
@ -57,14 +57,14 @@ void Objects::clearSceneNode (Ogre::SceneNode *node)
|
|||
}
|
||||
}
|
||||
|
||||
void Objects::setMwRoot(Ogre::SceneNode* root)
|
||||
void Objects::setRootNode(Ogre::SceneNode* root)
|
||||
{
|
||||
mMwRoot = root;
|
||||
mRootNode = root;
|
||||
}
|
||||
|
||||
void Objects::insertBegin (const MWWorld::Ptr& ptr, bool enabled, bool static_)
|
||||
{
|
||||
Ogre::SceneNode* root = mMwRoot;
|
||||
Ogre::SceneNode* root = mRootNode;
|
||||
Ogre::SceneNode* cellnode;
|
||||
if(mCellSceneNodes.find(ptr.getCell()) == mCellSceneNodes.end())
|
||||
{
|
||||
|
@ -390,9 +390,9 @@ void Objects::enableLights()
|
|||
std::vector<LightInfo>::iterator it = mLights.begin();
|
||||
while (it != mLights.end())
|
||||
{
|
||||
if (mMwRoot->getCreator()->hasLight(it->name))
|
||||
if (mRootNode->getCreator()->hasLight(it->name))
|
||||
{
|
||||
mMwRoot->getCreator()->getLight(it->name)->setVisible(true);
|
||||
mRootNode->getCreator()->getLight(it->name)->setVisible(true);
|
||||
++it;
|
||||
}
|
||||
else
|
||||
|
@ -405,9 +405,9 @@ void Objects::disableLights()
|
|||
std::vector<LightInfo>::iterator it = mLights.begin();
|
||||
while (it != mLights.end())
|
||||
{
|
||||
if (mMwRoot->getCreator()->hasLight(it->name))
|
||||
if (mRootNode->getCreator()->hasLight(it->name))
|
||||
{
|
||||
mMwRoot->getCreator()->getLight(it->name)->setVisible(false);
|
||||
mRootNode->getCreator()->getLight(it->name)->setVisible(false);
|
||||
++it;
|
||||
}
|
||||
else
|
||||
|
@ -460,9 +460,9 @@ void Objects::update(const float dt)
|
|||
std::vector<LightInfo>::iterator it = mLights.begin();
|
||||
while (it != mLights.end())
|
||||
{
|
||||
if (mMwRoot->getCreator()->hasLight(it->name))
|
||||
if (mRootNode->getCreator()->hasLight(it->name))
|
||||
{
|
||||
Ogre::Light* light = mMwRoot->getCreator()->getLight(it->name);
|
||||
Ogre::Light* light = mRootNode->getCreator()->getLight(it->name);
|
||||
|
||||
float brightness;
|
||||
float cycle_time;
|
||||
|
@ -550,7 +550,7 @@ void Objects::updateObjectCell(const MWWorld::Ptr &old, const MWWorld::Ptr &cur)
|
|||
MWWorld::CellStore *newCell = cur.getCell();
|
||||
|
||||
if(mCellSceneNodes.find(newCell) == mCellSceneNodes.end()) {
|
||||
node = mMwRoot->createChildSceneNode();
|
||||
node = mRootNode->createChildSceneNode();
|
||||
mCellSceneNodes[newCell] = node;
|
||||
} else {
|
||||
node = mCellSceneNodes[newCell];
|
||||
|
|
|
@ -53,7 +53,7 @@ class Objects{
|
|||
std::map<MWWorld::CellStore *, Ogre::StaticGeometry*> mStaticGeometrySmall;
|
||||
std::map<MWWorld::CellStore *, Ogre::AxisAlignedBox> mBounds;
|
||||
std::vector<LightInfo> mLights;
|
||||
Ogre::SceneNode* mMwRoot;
|
||||
Ogre::SceneNode* mRootNode;
|
||||
bool mIsStatic;
|
||||
static int uniqueID;
|
||||
|
||||
|
@ -90,7 +90,7 @@ public:
|
|||
|
||||
void removeCell(MWWorld::CellStore* store);
|
||||
void buildStaticGeometry(MWWorld::CellStore &cell);
|
||||
void setMwRoot(Ogre::SceneNode* root);
|
||||
void setRootNode(Ogre::SceneNode* root);
|
||||
|
||||
void rebuildStaticGeometry();
|
||||
|
||||
|
|
|
@ -141,25 +141,20 @@ RenderingManager::RenderingManager (OEngine::Render::OgreRenderer& _rend, const
|
|||
|
||||
applyCompositors();
|
||||
|
||||
// Turn the entire scene (represented by the 'root' node) -90
|
||||
// degrees around the x axis. This makes Z go upwards, and Y go into
|
||||
// the screen (when x is to the right.) This is the orientation that
|
||||
// Morrowind uses, and it automagically makes everything work as it
|
||||
// should.
|
||||
SceneNode *rt = mRendering.getScene()->getRootSceneNode();
|
||||
mMwRoot = rt;
|
||||
mRootNode = rt;
|
||||
|
||||
mObjects.setMwRoot(mMwRoot);
|
||||
mActors.setMwRoot(mMwRoot);
|
||||
mObjects.setRootNode(mRootNode);
|
||||
mActors.setRootNode(mRootNode);
|
||||
|
||||
Ogre::SceneNode *playerNode = mMwRoot->createChildSceneNode ("player");
|
||||
Ogre::SceneNode *playerNode = mRootNode->createChildSceneNode ("player");
|
||||
mPlayer = new MWRender::Player (mRendering.getCamera(), playerNode);
|
||||
|
||||
mShadows = new Shadows(&mRendering);
|
||||
|
||||
mTerrainManager = new TerrainManager(mRendering.getScene(), this);
|
||||
|
||||
mSkyManager = new SkyManager(mMwRoot, mRendering.getCamera());
|
||||
mSkyManager = new SkyManager(mRootNode, mRendering.getCamera());
|
||||
|
||||
mOcclusionQuery = new OcclusionQuery(&mRendering, mSkyManager->getSunNode());
|
||||
|
||||
|
@ -168,7 +163,7 @@ RenderingManager::RenderingManager (OEngine::Render::OgreRenderer& _rend, const
|
|||
|
||||
mSun = 0;
|
||||
|
||||
mDebugging = new Debugging(mMwRoot, engine);
|
||||
mDebugging = new Debugging(mRootNode, engine);
|
||||
mLocalMap = new MWRender::LocalMap(&mRendering, this);
|
||||
|
||||
setMenuTransparency(Settings::Manager::getFloat("menu transparency", "GUI"));
|
||||
|
@ -321,7 +316,7 @@ void RenderingManager::update (float duration, bool paused)
|
|||
Ogre::Vector3 orig, dest;
|
||||
mPlayer->setCameraDistance();
|
||||
if (!mPlayer->getPosition(orig, dest)) {
|
||||
orig.z += mPlayer->getHeight() * mMwRoot->getScale().z;
|
||||
orig.z += mPlayer->getHeight() * mRootNode->getScale().z;
|
||||
|
||||
btVector3 btOrig(orig.x, orig.y, orig.z);
|
||||
btVector3 btDest(dest.x, dest.y, dest.z);
|
||||
|
|
|
@ -228,10 +228,7 @@ class RenderingManager: private RenderingInterface, public Ogre::WindowEventList
|
|||
Ogre::ColourValue mAmbientColor;
|
||||
Ogre::Light* mSun;
|
||||
|
||||
/// Root node for all objects added to the scene. This is rotated so
|
||||
/// that the OGRE coordinate system matches that used internally in
|
||||
/// Morrowind.
|
||||
Ogre::SceneNode *mMwRoot;
|
||||
Ogre::SceneNode *mRootNode;
|
||||
|
||||
OEngine::Physic::PhysicEngine* mPhysicsEngine;
|
||||
|
||||
|
|
|
@ -203,7 +203,7 @@ unsigned int Moon::getPhaseInt() const
|
|||
return 0;
|
||||
}
|
||||
|
||||
SkyManager::SkyManager (SceneNode* pMwRoot, Camera* pCamera)
|
||||
SkyManager::SkyManager (SceneNode* root, Camera* pCamera)
|
||||
: mHour(0.0f)
|
||||
, mDay(0)
|
||||
, mMonth(0)
|
||||
|
@ -234,7 +234,7 @@ SkyManager::SkyManager (SceneNode* pMwRoot, Camera* pCamera)
|
|||
, mCloudAnimationTimer(0.f)
|
||||
, mMoonRed(false)
|
||||
{
|
||||
mSceneMgr = pMwRoot->getCreator();
|
||||
mSceneMgr = root->getCreator();
|
||||
mRootNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
|
||||
mRootNode->setInheritOrientation(false);
|
||||
}
|
||||
|
|
|
@ -112,7 +112,7 @@ namespace MWRender
|
|||
class SkyManager
|
||||
{
|
||||
public:
|
||||
SkyManager(Ogre::SceneNode* pMwRoot, Ogre::Camera* pCamera);
|
||||
SkyManager(Ogre::SceneNode* root, Ogre::Camera* pCamera);
|
||||
~SkyManager();
|
||||
|
||||
void update(float duration);
|
||||
|
|
Loading…
Reference in a new issue