mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-22 09:53:54 +00:00
add getNorthVector method
This commit is contained in:
parent
6c8be7205a
commit
4249d2c536
2 changed files with 19 additions and 0 deletions
|
@ -701,6 +701,7 @@ namespace MWWorld
|
||||||
|
|
||||||
void World::update (float duration)
|
void World::update (float duration)
|
||||||
{
|
{
|
||||||
|
getNorthVector(mWorldScene->getCurrentCell());
|
||||||
mWorldScene->update (duration);
|
mWorldScene->update (duration);
|
||||||
|
|
||||||
mWeatherManager->update (duration);
|
mWeatherManager->update (duration);
|
||||||
|
@ -754,4 +755,19 @@ namespace MWWorld
|
||||||
{
|
{
|
||||||
return mRendering->getFader();
|
return mRendering->getFader();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Ogre::Vector2 World::getNorthVector(Ptr::CellStore* cell)
|
||||||
|
{
|
||||||
|
ESMS::CellRefList<ESM::Static, MWWorld::RefData> statics = cell->statics;
|
||||||
|
ESMS::LiveCellRef<ESM::Static, MWWorld::RefData>* ref = statics.find("northmarker");
|
||||||
|
if (!ref)
|
||||||
|
{
|
||||||
|
std::cout << "No north marker found." << std::endl;
|
||||||
|
return Vector2(0, 1);
|
||||||
|
}
|
||||||
|
Ogre::SceneNode* node = ref->mData.getBaseNode();
|
||||||
|
Vector3 dir = -node->_getDerivedOrientation().zAxis();
|
||||||
|
Vector2 d = Vector2(dir.x, dir.z);
|
||||||
|
return d;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -129,6 +129,9 @@ namespace MWWorld
|
||||||
bool isCellExterior() const;
|
bool isCellExterior() const;
|
||||||
bool isCellQuasiExterior() const;
|
bool isCellQuasiExterior() const;
|
||||||
|
|
||||||
|
Ogre::Vector2 getNorthVector(Ptr::CellStore* cell);
|
||||||
|
///< get north vector (OGRE coordinates) for given interior cell
|
||||||
|
|
||||||
Globals::Data& getGlobalVariable (const std::string& name);
|
Globals::Data& getGlobalVariable (const std::string& name);
|
||||||
|
|
||||||
Globals::Data getGlobalVariable (const std::string& name) const;
|
Globals::Data getGlobalVariable (const std::string& name) const;
|
||||||
|
|
Loading…
Reference in a new issue