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>
|
2010-06-05 18:37:01 +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;
|
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;
|
|
|
|
|
|
|
|
MWRender::Player *mPlayer;
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
MWScene (OEngine::Render::OgreRenderer &_rend);
|
|
|
|
|
|
|
|
~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
|
|
|
|
|
|
|
/// Run physics simulation and modify \a world accordingly.
|
|
|
|
void doPhysics (float duration, MWWorld::World& world);
|
|
|
|
|
|
|
|
/// Inform phyiscs system about desired velocity vectors for actors
|
|
|
|
/// (in Morrowind coordinates).
|
|
|
|
void setMovement (const std::vector<std::string, Ogre::Vector3>& actors);
|
2011-01-08 14:11:37 +00:00
|
|
|
};
|
2010-06-05 18:37:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|