2010-06-05 18:37:01 +00:00
|
|
|
#ifndef _GAME_RENDER_MWSCENE_H
|
|
|
|
#define _GAME_RENDER_MWSCENE_H
|
|
|
|
|
2010-08-03 18:40:45 +00:00
|
|
|
#include <utility>
|
2010-07-16 12:26:46 +00:00
|
|
|
#include <openengine/ogre/renderer.hpp>
|
2011-02-26 15:37:47 +00:00
|
|
|
#include <openengine/bullet/physic.hpp>
|
2010-06-05 18:37:01 +00:00
|
|
|
|
2011-01-25 16:56:49 +00:00
|
|
|
#include <vector>
|
2011-02-10 12:32:34 +00:00
|
|
|
#include <string>
|
2011-01-25 16:56:49 +00:00
|
|
|
|
2010-06-06 11:36:45 +00:00
|
|
|
namespace Ogre
|
|
|
|
{
|
|
|
|
class Camera;
|
|
|
|
class Viewport;
|
|
|
|
class SceneManager;
|
|
|
|
class SceneNode;
|
2010-08-03 18:17:31 +00:00
|
|
|
class RaySceneQuery;
|
2011-01-25 16:56:49 +00:00
|
|
|
class Quaternion;
|
|
|
|
class Vector3;
|
2010-06-06 11:36:45 +00:00
|
|
|
}
|
|
|
|
|
2010-08-25 07:19:15 +00:00
|
|
|
namespace MWWorld
|
|
|
|
{
|
|
|
|
class World;
|
|
|
|
}
|
|
|
|
|
2010-06-08 11:53:34 +00:00
|
|
|
namespace MWRender
|
2010-06-05 18:37:01 +00:00
|
|
|
{
|
2011-01-08 14:11:37 +00:00
|
|
|
class Player;
|
|
|
|
|
|
|
|
/// \brief 3D-scene (rendering and physics)
|
|
|
|
|
|
|
|
class MWScene
|
|
|
|
{
|
|
|
|
OEngine::Render::OgreRenderer &rend;
|
|
|
|
|
|
|
|
/// Root node for all objects added to the scene. This is rotated so
|
|
|
|
/// that the OGRE coordinate system matches that used internally in
|
|
|
|
/// Morrowind.
|
|
|
|
Ogre::SceneNode *mwRoot;
|
|
|
|
Ogre::RaySceneQuery *mRaySceneQuery;
|
|
|
|
|
2011-04-01 21:35:56 +00:00
|
|
|
OEngine::Physic::PhysicEngine* eng;
|
2011-02-19 10:36:57 +00:00
|
|
|
|
2011-01-08 14:11:37 +00:00
|
|
|
MWRender::Player *mPlayer;
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2011-02-19 18:18:03 +00:00
|
|
|
MWScene (OEngine::Render::OgreRenderer &_rend , OEngine::Physic::PhysicEngine* physEng);
|
2011-01-08 14:11:37 +00:00
|
|
|
|
|
|
|
~MWScene();
|
|
|
|
|
|
|
|
Ogre::Camera *getCamera() { return rend.getCamera(); }
|
|
|
|
Ogre::SceneNode *getRoot() { return mwRoot; }
|
|
|
|
Ogre::SceneManager *getMgr() { return rend.getScene(); }
|
|
|
|
Ogre::Viewport *getViewport() { return rend.getViewport(); }
|
|
|
|
Ogre::RaySceneQuery *getRaySceneQuery() { return mRaySceneQuery; }
|
|
|
|
MWRender::Player *getPlayer() { return mPlayer; }
|
|
|
|
|
|
|
|
/// Gets the handle of the object the player is looking at
|
|
|
|
/// pair<name, distance>
|
|
|
|
/// name is empty and distance = -1 if there is no object which
|
|
|
|
/// can be faced
|
|
|
|
std::pair<std::string, float> getFacedHandle (MWWorld::World& world);
|
2011-01-23 14:28:42 +00:00
|
|
|
|
2011-03-16 08:09:45 +00:00
|
|
|
/// Toggle render mode
|
|
|
|
/// \todo Using an int instead of a enum here to avoid cyclic includes. Will be fixed
|
|
|
|
/// when the mw*-refactoring is done.
|
2011-04-26 19:38:21 +00:00
|
|
|
/// \return Resulting mode
|
|
|
|
bool toggleRenderMode (int mode);
|
2011-01-08 14:11:37 +00:00
|
|
|
};
|
2010-06-05 18:37:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|