mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-20 06:53:52 +00:00
attached camera to a scene node
This commit is contained in:
parent
151560b882
commit
9c6bc4975c
4 changed files with 13 additions and 3 deletions
|
@ -42,7 +42,10 @@ MWScene::MWScene(OEngine::Render::OgreRenderer &_rend)
|
||||||
//used to obtain ingame information of ogre objects (which are faced or selected)
|
//used to obtain ingame information of ogre objects (which are faced or selected)
|
||||||
mRaySceneQuery = rend.getScene()->createRayQuery(Ray());
|
mRaySceneQuery = rend.getScene()->createRayQuery(Ray());
|
||||||
|
|
||||||
mPlayer = new MWRender::Player (getCamera());
|
Ogre::SceneNode *playerNode = mwRoot->createChildSceneNode();
|
||||||
|
playerNode->attachObject (getCamera());
|
||||||
|
|
||||||
|
mPlayer = new MWRender::Player (getCamera(), playerNode->getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
MWScene::~MWScene()
|
MWScene::~MWScene()
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
namespace MWRender
|
namespace MWRender
|
||||||
{
|
{
|
||||||
Player::Player (Ogre::Camera *camera) : mCamera (camera)
|
Player::Player (Ogre::Camera *camera, const std::string& handle)
|
||||||
|
: mCamera (camera), mHandle (handle)
|
||||||
{}
|
{}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#ifndef GAME_MWRENDER_PLAYER_H
|
#ifndef GAME_MWRENDER_PLAYER_H
|
||||||
#define GAME_MWRENDER_PLAYER_H
|
#define GAME_MWRENDER_PLAYER_H
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
namespace Ogre
|
namespace Ogre
|
||||||
{
|
{
|
||||||
class Camera;
|
class Camera;
|
||||||
|
@ -12,12 +14,15 @@ namespace MWRender
|
||||||
class Player
|
class Player
|
||||||
{
|
{
|
||||||
Ogre::Camera *mCamera;
|
Ogre::Camera *mCamera;
|
||||||
|
std::string mHandle;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Player (Ogre::Camera *camera);
|
Player (Ogre::Camera *camera, const std::string& handle);
|
||||||
|
|
||||||
Ogre::Camera *getCamera() { return mCamera; }
|
Ogre::Camera *getCamera() { return mCamera; }
|
||||||
|
|
||||||
|
std::string getHandle() const { return mHandle; }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@ namespace MWWorld
|
||||||
mMale = !(player->flags & ESM::NPC::Female);
|
mMale = !(player->flags & ESM::NPC::Female);
|
||||||
mRace = player->race;
|
mRace = player->race;
|
||||||
mPlayer.ref.pos.pos[0] = mPlayer.ref.pos.pos[1] = mPlayer.ref.pos.pos[2] = 0;
|
mPlayer.ref.pos.pos[0] = mPlayer.ref.pos.pos[1] = mPlayer.ref.pos.pos[2] = 0;
|
||||||
|
mPlayer.mData.setHandle (renderer->getHandle());
|
||||||
mClass = new ESM::Class (*world.getStore().classes.find (player->cls));
|
mClass = new ESM::Class (*world.getStore().classes.find (player->cls));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue