2011-07-31 15:07:11 +00:00
|
|
|
#ifndef GAME_MWWORLD_SCENE_H
|
|
|
|
#define GAME_MWWORLD_SCENE_H
|
|
|
|
|
2011-08-01 01:33:02 +00:00
|
|
|
#include <vector>
|
|
|
|
#include <map>
|
|
|
|
|
|
|
|
#include <boost/filesystem.hpp>
|
|
|
|
|
2011-07-31 15:07:11 +00:00
|
|
|
#include <components/esm_store/cell_store.hpp>
|
2011-08-01 01:33:02 +00:00
|
|
|
|
2011-07-31 15:07:11 +00:00
|
|
|
#include "../mwrender/mwscene.hpp"
|
2011-08-01 13:55:36 +00:00
|
|
|
#include "physicssystem.hpp"
|
2011-07-31 15:07:11 +00:00
|
|
|
|
2011-08-01 01:33:02 +00:00
|
|
|
#include "refdata.hpp"
|
|
|
|
#include "ptr.hpp"
|
|
|
|
#include "globals.hpp"
|
|
|
|
|
|
|
|
#include <openengine/bullet/physic.hpp>
|
|
|
|
|
|
|
|
namespace Ogre
|
|
|
|
{
|
|
|
|
class Vector3;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace ESM
|
|
|
|
{
|
|
|
|
struct Position;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace Files
|
|
|
|
{
|
|
|
|
class Collections;
|
|
|
|
}
|
|
|
|
|
2011-07-31 15:07:11 +00:00
|
|
|
namespace Render
|
|
|
|
{
|
|
|
|
class OgreRenderer;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace MWRender
|
|
|
|
{
|
|
|
|
class SkyManager;
|
|
|
|
class CellRender;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace MWWorld
|
|
|
|
{
|
2011-08-01 01:33:02 +00:00
|
|
|
class Environment;
|
|
|
|
class Player;
|
|
|
|
|
2011-07-31 15:07:11 +00:00
|
|
|
class Scene
|
|
|
|
{
|
2011-08-01 01:33:02 +00:00
|
|
|
|
2011-07-31 15:07:11 +00:00
|
|
|
public:
|
2011-08-01 01:33:02 +00:00
|
|
|
|
2011-07-31 15:07:11 +00:00
|
|
|
private:
|
2011-08-01 01:33:02 +00:00
|
|
|
|
2011-07-31 15:07:11 +00:00
|
|
|
typedef std::map<Ptr::CellStore *, MWRender::CellRender *> CellRenderCollection;
|
2011-08-01 01:33:02 +00:00
|
|
|
|
|
|
|
MWRender::MWScene mScene;
|
2011-07-31 15:07:11 +00:00
|
|
|
Ptr::CellStore *mCurrentCell; // the cell, the player is in
|
2011-08-01 01:33:02 +00:00
|
|
|
CellRenderCollection mActiveCells;
|
|
|
|
bool mCellChanged;
|
2011-07-31 15:07:11 +00:00
|
|
|
Environment& mEnvironment;
|
|
|
|
World *mWorld;
|
2011-08-01 13:55:36 +00:00
|
|
|
PhysicsSystem *mPhysics;
|
2011-08-01 01:33:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
void playerCellChange (Ptr::CellStore *cell, const ESM::Position& position,
|
|
|
|
bool adjustPlayerPos = true);
|
|
|
|
public:
|
|
|
|
|
2011-08-01 13:55:36 +00:00
|
|
|
Scene (Environment& environment, World *world, MWRender::MWScene& scene, PhysicsSystem *physics);
|
2011-08-01 01:33:02 +00:00
|
|
|
|
|
|
|
~Scene();
|
|
|
|
|
2011-08-01 02:06:38 +00:00
|
|
|
void unloadCell (CellRenderCollection::iterator iter);
|
|
|
|
|
|
|
|
void loadCell (Ptr::CellStore *cell, MWRender::CellRender *render);
|
|
|
|
|
|
|
|
void changeCell (int X, int Y, const ESM::Position& position, bool adjustPlayerPos);
|
|
|
|
///< Move from exterior to interior or from interior cell to a different
|
|
|
|
/// interior cell.
|
|
|
|
|
|
|
|
Ptr::CellStore* getCurrentCell ();
|
|
|
|
|
|
|
|
CellRenderCollection getActiveCells ();
|
|
|
|
|
2011-08-01 01:33:02 +00:00
|
|
|
bool hasCellChanged() const;
|
|
|
|
///< Has the player moved to a different cell, since the last frame?
|
|
|
|
|
2011-08-01 02:30:21 +00:00
|
|
|
void changeToInteriorCell (const std::string& cellName, const ESM::Position& position);
|
2011-08-01 01:33:02 +00:00
|
|
|
///< Move to interior cell.
|
|
|
|
|
2011-08-01 02:30:21 +00:00
|
|
|
void changeToExteriorCell (const ESM::Position& position);
|
2011-08-01 01:33:02 +00:00
|
|
|
///< Move to exterior cell.
|
|
|
|
|
2011-08-01 02:30:21 +00:00
|
|
|
void markCellAsUnchanged();
|
2011-08-01 01:33:02 +00:00
|
|
|
|
|
|
|
std::string getFacedHandle();
|
|
|
|
};
|
2011-07-31 15:07:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|