1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-10 15:39:02 +00:00
OpenMW/apps/openmw/mwworld/scene.hpp

118 lines
2.9 KiB
C++
Raw Normal View History

#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>
#include <openengine/bullet/physic.hpp>
#include <components/esm_store/cell_store.hpp>
2011-08-01 01:33:02 +00:00
#include "../mwrender/renderingmanager.hpp"
#include "../mwrender/renderinginterface.hpp"
#include "physicssystem.hpp"
2011-08-01 01:33:02 +00:00
#include "refdata.hpp"
#include "ptr.hpp"
#include "globals.hpp"
namespace Ogre
{
class Vector3;
}
namespace ESM
{
struct Position;
}
namespace Files
{
class Collections;
}
namespace Render
{
class OgreRenderer;
}
namespace MWRender
{
class SkyManager;
class CellRender;
}
namespace MWWorld
{
2011-08-01 01:33:02 +00:00
class Player;
class Scene
{
2011-08-01 01:33:02 +00:00
public:
2011-08-01 01:33:02 +00:00
typedef std::set<Ptr::CellStore *> CellStoreCollection;
2011-08-01 01:33:02 +00:00
2011-09-04 07:48:50 +00:00
private:
//OEngine::Render::OgreRenderer& mRenderer;
Ptr::CellStore* mCurrentCell; // the cell, the player is in
CellStoreCollection mActiveCells;
2011-08-01 01:33:02 +00:00
bool mCellChanged;
World *mWorld;
2011-08-01 13:55:36 +00:00
PhysicsSystem *mPhysics;
MWRender::RenderingManager& mRendering;
2011-08-01 01:33:02 +00:00
void playerCellChange (Ptr::CellStore *cell, const ESM::Position& position,
bool adjustPlayerPos = true);
2011-08-01 01:33:02 +00:00
public:
Scene (World *world, MWRender::RenderingManager& rendering, PhysicsSystem *physics);
2011-08-01 01:33:02 +00:00
~Scene();
void unloadCell (CellStoreCollection::iterator iter);
void loadCell (Ptr::CellStore *cell);
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.
2011-08-09 07:56:09 +00:00
Ptr::CellStore* getCurrentCell ();
2011-08-09 07:56:09 +00:00
const CellStoreCollection& getActiveCells () const;
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-09 07:56:09 +00:00
void changeToExteriorCell (const ESM::Position& position);
2011-08-01 01:33:02 +00:00
///< Move to exterior cell.
2011-08-09 07:56:09 +00:00
void markCellAsUnchanged();
2011-08-01 01:33:02 +00:00
void insertCell(ESMS::CellStore<MWWorld::RefData> &cell);
2012-05-14 15:41:17 +00:00
/// this method is only meant for dropping objects into the gameworld from a container
/// and thus only handles object types that can be placed in a container
void insertObject(MWWorld::Ptr object, Ptr::CellStore* cell);
void update (float duration);
void addObjectToScene (const Ptr& ptr);
///< Add an object that already exists in the world model to the scene.
void removeObjectFromScene (const Ptr& ptr);
///< Remove an object from the scene, but not from the world model.
2011-08-01 01:33:02 +00:00
};
}
#endif