forked from teamnwah/openmw-tes3coop
player arrow works again
This commit is contained in:
parent
01ecf3e0be
commit
0c2317ce9d
1 changed files with 11 additions and 3 deletions
|
@ -11,7 +11,8 @@
|
|||
using namespace MWRender;
|
||||
using namespace Ogre;
|
||||
|
||||
LocalMap::LocalMap(OEngine::Render::OgreRenderer* rend, MWWorld::Environment* env)
|
||||
LocalMap::LocalMap(OEngine::Render::OgreRenderer* rend, MWWorld::Environment* env) :
|
||||
mInterior(false), mCellX(0), mCellY(0)
|
||||
{
|
||||
mRendering = rend;
|
||||
mEnvironment = env;
|
||||
|
@ -93,6 +94,8 @@ void LocalMap::requestMap(MWWorld::Ptr::CellStore* cell)
|
|||
{
|
||||
mInterior = false;
|
||||
|
||||
mCameraRotNode->setOrientation(Quaternion::IDENTITY);
|
||||
|
||||
std::string name = "Cell_"+coordStr(cell->cell->data.gridX, cell->cell->data.gridY);
|
||||
|
||||
int x = cell->cell->data.gridX;
|
||||
|
@ -235,7 +238,12 @@ void LocalMap::updatePlayer (const Ogre::Vector3& position, const Ogre::Vector3&
|
|||
|
||||
// retrieve the x,y grid coordinates the player is in
|
||||
int x,y;
|
||||
Vector2 pos(position.x, position.z);
|
||||
Vector3 _pos(position.x, 0, position.z);
|
||||
_pos = mCameraRotNode->convertWorldToLocalPosition(_pos);
|
||||
Vector2 pos(_pos.x, _pos.z);
|
||||
|
||||
Vector3 playerdirection = mCameraRotNode->convertWorldToLocalPosition(direction);
|
||||
|
||||
if (!mInterior)
|
||||
{
|
||||
x = std::ceil(pos.x / sSize)-1;
|
||||
|
@ -273,7 +281,7 @@ void LocalMap::updatePlayer (const Ogre::Vector3& position, const Ogre::Vector3&
|
|||
texName = mInteriorName + "_" + coordStr(x,y);
|
||||
}
|
||||
mEnvironment->mWindowManager->setPlayerPos(u, v);
|
||||
mEnvironment->mWindowManager->setPlayerDir(direction.x, -direction.z);
|
||||
mEnvironment->mWindowManager->setPlayerDir(playerdirection.x, -playerdirection.z);
|
||||
|
||||
// explore radius (squared)
|
||||
const float sqrExploreRadius = 0.01 * sFogOfWarResolution*sFogOfWarResolution;
|
||||
|
|
Loading…
Reference in a new issue