forked from teamnwah/openmw-tes3coop
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)
|
||||
{
|
||||
getNorthVector(mWorldScene->getCurrentCell());
|
||||
mWorldScene->update (duration);
|
||||
|
||||
mWeatherManager->update (duration);
|
||||
|
@ -754,4 +755,19 @@ namespace MWWorld
|
|||
{
|
||||
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 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) const;
|
||||
|
|
Loading…
Reference in a new issue