1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 00:19:56 +00:00
openmw-tes3mp/apps/openmw/mwrender/player.hpp

66 lines
1.5 KiB
C++
Raw Normal View History

#ifndef GAME_MWRENDER_PLAYER_H
#define GAME_MWRENDER_PLAYER_H
#include <string>
2011-02-10 11:56:19 +00:00
namespace Ogre
{
class Vector3;
class Camera;
class SceneNode;
}
namespace MWWorld
{
class Ptr;
}
namespace MWRender
{
/// \brief Player character rendering and camera control
class Player
{
Ogre::Camera *mCamera;
Ogre::SceneNode* mNode;
bool mFirstPersonView;
bool mVanityModeEnabled;
2012-08-11 10:54:33 +00:00
float controlFlip(float shift = 0.f);
/// Updates sound manager listener data
void updateListener();
public:
Player (Ogre::Camera *camera, Ogre::SceneNode* mNode);
/// Set where the player is looking at. Uses Morrowind (euler) angles
2012-08-11 09:23:54 +00:00
/// \param rot Rotation angles in radians
/// \return true if player object needs to bo rotated physically
bool setRotation(const Ogre::Vector3 &rot);
2012-08-11 09:23:54 +00:00
/// \param rot Rotation angles in radians
/// \return true if player object needs to bo rotated physically
bool adjustRotation(const Ogre::Vector3 &rot);
std::string getHandle() const;
/// Attach camera to object
/// \note there is no protection from attaching the same camera to
/// several different objects
void attachTo(const MWWorld::Ptr &);
2011-02-10 11:56:19 +00:00
void toggleViewMode() {
mFirstPersonView = !mFirstPersonView;
}
void toggleVanityMode() {
mVanityModeEnabled = !mVanityModeEnabled;
}
};
}
#endif