|
|
|
@ -9,7 +9,7 @@
|
|
|
|
|
namespace MWWorld
|
|
|
|
|
{
|
|
|
|
|
Player::Player (MWRender::Player *renderer, const ESM::NPC *player, MWWorld::World& world) :
|
|
|
|
|
mCellStore (0), mRenderer (renderer), mWorld (world), mClass (0), mCollisionMode (true),
|
|
|
|
|
mCellStore (0), mRenderer (renderer), mWorld (world), mClass (0),
|
|
|
|
|
mAutoMove (false), mForwardBackward (0)
|
|
|
|
|
{
|
|
|
|
|
mPlayer.base = player;
|
|
|
|
@ -37,27 +37,6 @@ namespace MWWorld
|
|
|
|
|
-mPlayer.ref.pos.pos[1]));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Player::moveRel (float &relX, float &relY, float &relZ)
|
|
|
|
|
{
|
|
|
|
|
// Move camera relative to its own direction
|
|
|
|
|
mRenderer->getCamera()->moveRelative (Ogre::Vector3(relX,0,relZ));
|
|
|
|
|
|
|
|
|
|
// Up/down movement is always done relative the world axis.
|
|
|
|
|
mRenderer->getCamera()->move (Ogre::Vector3(0,relY,0));
|
|
|
|
|
|
|
|
|
|
// Get new camera position, converting back to MW coords.
|
|
|
|
|
Ogre::Vector3 pos = mRenderer->getCamera()->getPosition();
|
|
|
|
|
relX = pos[0];
|
|
|
|
|
relY = -pos[2];
|
|
|
|
|
relZ = pos[1];
|
|
|
|
|
|
|
|
|
|
// TODO: Collision detection must be used to find the REAL new
|
|
|
|
|
// position, if mCollisionMode==true
|
|
|
|
|
|
|
|
|
|
// Set the position
|
|
|
|
|
setPos(relX, relY, relZ);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Player::setClass (const ESM::Class& class_)
|
|
|
|
|
{
|
|
|
|
|
ESM::Class *new_class = new ESM::Class (class_);
|
|
|
|
|