2011-10-20 19:02:19 +00:00
|
|
|
#ifndef _GAME_RENDERING_MANAGER_H
|
|
|
|
#define _GAME_RENDERING_MANAGER_H
|
|
|
|
|
|
|
|
|
|
|
|
#include "sky.hpp"
|
2011-10-30 04:25:29 +00:00
|
|
|
#include "debugging.hpp"
|
2011-10-20 19:02:19 +00:00
|
|
|
|
2011-10-20 22:15:30 +00:00
|
|
|
#include <utility>
|
2011-10-20 19:02:19 +00:00
|
|
|
#include <openengine/ogre/renderer.hpp>
|
|
|
|
#include <openengine/bullet/physic.hpp>
|
2011-10-20 22:15:30 +00:00
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "../mwworld/ptr.hpp"
|
|
|
|
|
2011-10-20 19:02:19 +00:00
|
|
|
#include <boost/filesystem.hpp>
|
2011-11-01 03:59:16 +00:00
|
|
|
#include "objects.hpp"
|
|
|
|
#include "npcs.hpp"
|
|
|
|
#include "creatures.hpp"
|
2011-10-20 19:02:19 +00:00
|
|
|
|
2011-10-20 22:15:30 +00:00
|
|
|
namespace Ogre
|
|
|
|
{
|
|
|
|
class Camera;
|
|
|
|
class Viewport;
|
|
|
|
class SceneManager;
|
|
|
|
class SceneNode;
|
|
|
|
class RaySceneQuery;
|
|
|
|
class Quaternion;
|
|
|
|
class Vector3;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace MWWorld
|
2011-10-20 19:02:19 +00:00
|
|
|
{
|
2011-10-20 22:15:30 +00:00
|
|
|
class World;
|
|
|
|
}
|
2011-10-20 19:02:19 +00:00
|
|
|
|
2011-10-20 22:15:30 +00:00
|
|
|
namespace MWRender
|
|
|
|
{
|
2011-11-01 03:59:16 +00:00
|
|
|
class Player;
|
|
|
|
class RenderingInterface{
|
|
|
|
public:
|
|
|
|
virtual MWRender::Npcs& getNPCs();
|
|
|
|
virtual MWRender::Creatures& getCreatures();
|
|
|
|
virtual MWRender::Objects& getObjects();
|
2011-11-01 17:46:57 +00:00
|
|
|
virtual MWRender::Player& getPlayer();
|
2011-11-01 03:59:16 +00:00
|
|
|
};
|
2011-10-22 04:15:15 +00:00
|
|
|
|
2011-11-01 03:59:16 +00:00
|
|
|
class RenderingManager: private RenderingInterface {
|
2011-10-20 22:15:30 +00:00
|
|
|
|
2011-11-02 04:13:33 +00:00
|
|
|
|
2011-10-20 22:15:30 +00:00
|
|
|
|
2011-10-20 19:02:19 +00:00
|
|
|
public:
|
2011-10-30 04:25:29 +00:00
|
|
|
RenderingManager(OEngine::Render::OgreRenderer& _rend, const boost::filesystem::path& resDir, OEngine::Physic::PhysicEngine* engine);
|
2011-10-20 19:02:19 +00:00
|
|
|
~RenderingManager();
|
2011-11-01 03:59:16 +00:00
|
|
|
virtual MWRender::Npcs& getNPCs();
|
|
|
|
virtual MWRender::Creatures& getCreatures();
|
|
|
|
virtual MWRender::Objects& getObjects();
|
2011-11-01 17:46:57 +00:00
|
|
|
virtual MWRender::Player& getPlayer();
|
2011-10-30 04:25:29 +00:00
|
|
|
bool toggleRenderMode(int mode);
|
2011-10-20 19:02:19 +00:00
|
|
|
|
|
|
|
void removeCell (MWWorld::Ptr::CellStore *store); // TODO do we want this?
|
|
|
|
|
|
|
|
void addObject (const MWWorld::Ptr& ptr, MWWorld::Ptr::CellStore *store);
|
|
|
|
void removeObject (const MWWorld::Ptr& ptr, MWWorld::Ptr::CellStore *store);
|
|
|
|
|
|
|
|
void moveObject (const MWWorld::Ptr& ptr, const Ogre::Vector3& position);
|
|
|
|
void scaleObject (const MWWorld::Ptr& ptr, const Ogre::Vector3& scale);
|
|
|
|
void rotateObject (const MWWorld::Ptr& ptr, const::Ogre::Quaternion& orientation);
|
|
|
|
void moveObjectToCell (const MWWorld::Ptr& ptr, const Ogre::Vector3& position, MWWorld::Ptr::CellStore *store);
|
|
|
|
|
|
|
|
void setPhysicsDebugRendering (bool);
|
|
|
|
bool getPhysicsDebugRendering() const;
|
|
|
|
|
|
|
|
void update (float duration);
|
|
|
|
|
|
|
|
void skyEnable ();
|
|
|
|
void skyDisable ();
|
|
|
|
void skySetHour (double hour);
|
|
|
|
void skySetDate (int day, int month);
|
|
|
|
int skyGetMasserPhase() const;
|
|
|
|
int skyGetSecundaPhase() const;
|
|
|
|
void skySetMoonColour (bool red);
|
2011-10-25 02:11:36 +00:00
|
|
|
OEngine::Render::OgreRenderer& getOgreRenderer(){return rend;}
|
2011-10-24 17:42:36 +00:00
|
|
|
Ogre::SceneManager *getMgr() { return rend.getScene(); }
|
|
|
|
Ogre::SceneNode *getRoot() { return mwRoot; }
|
2011-11-01 03:59:16 +00:00
|
|
|
|
2011-10-20 19:02:19 +00:00
|
|
|
private:
|
|
|
|
|
|
|
|
SkyManager* mSkyManager;
|
2011-11-02 04:13:33 +00:00
|
|
|
OEngine::Render::OgreRenderer &rend;
|
|
|
|
Ogre::Camera* camera;
|
|
|
|
MWRender::Npcs npcs;
|
|
|
|
MWRender::Creatures creatures;
|
|
|
|
MWRender::Objects objects;
|
|
|
|
|
|
|
|
/// 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;
|
|
|
|
|
|
|
|
OEngine::Physic::PhysicEngine* eng;
|
|
|
|
|
|
|
|
MWRender::Player *mPlayer;
|
|
|
|
MWRender::Debugging mDebugging;
|
2011-10-20 19:02:19 +00:00
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|