1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 16:49:55 +00:00
openmw-tes3mp/apps/openmw/mwworld/scene.hpp

123 lines
2.9 KiB
C++
Raw Normal View History

#ifndef GAME_MWWORLD_SCENE_H
#define GAME_MWWORLD_SCENE_H
#include "../mwrender/renderingmanager.hpp"
#include "ptr.hpp"
2011-08-01 01:33:02 +00:00
#include "globals.hpp"
namespace Ogre
{
class Vector3;
}
namespace ESM
{
struct Position;
}
namespace Files
{
class Collections;
}
2014-02-23 19:11:05 +00:00
namespace Loading
{
class Listener;
}
namespace Render
{
class OgreRenderer;
}
namespace MWRender
{
class SkyManager;
class CellRender;
}
namespace MWWorld
{
class PhysicsSystem;
2011-08-01 01:33:02 +00:00
class Player;
class CellStore;
2011-08-01 01:33:02 +00:00
class Scene
{
public:
2011-08-01 01:33:02 +00:00
typedef std::set<CellStore *> CellStoreCollection;
2011-08-01 01:33:02 +00:00
2011-09-04 07:48:50 +00:00
private:
//OEngine::Render::OgreRenderer& mRenderer;
2013-05-15 15:54:18 +00:00
CellStore* mCurrentCell; // the cell the player is in
CellStoreCollection mActiveCells;
2011-08-01 01:33:02 +00:00
bool mCellChanged;
2011-08-01 13:55:36 +00:00
PhysicsSystem *mPhysics;
MWRender::RenderingManager& mRendering;
2011-08-01 01:33:02 +00:00
bool mNeedMapUpdate;
void insertCell (CellStore &cell, bool rescale, Loading::Listener* loadingListener);
// Load and unload cells as necessary to create a cell grid with "X" and "Y" in the center
void changeCellGrid (int X, int Y);
void getGridCenter(int& cellX, int& cellY);
2011-08-01 01:33:02 +00:00
public:
Scene (MWRender::RenderingManager& rendering, PhysicsSystem *physics);
2011-08-01 01:33:02 +00:00
~Scene();
void unloadCell (CellStoreCollection::iterator iter);
void loadCell (CellStore *cell, Loading::Listener* loadingListener);
void playerMoved (const Ogre::Vector3& pos);
void changePlayerCell (CellStore* newCell, const ESM::Position& position, bool adjustPlayerPos);
2011-08-09 07:56:09 +00:00
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 set of active cells changed, since the last frame?
2011-08-01 01:33:02 +00:00
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.
void changeToExteriorCell (const ESM::Position& position, bool adjustPlayerPos);
2011-08-01 01:33:02 +00:00
///< Move to exterior cell.
2013-05-15 15:54:18 +00:00
void changeToVoid();
///< Change into a void
2011-08-09 07:56:09 +00:00
void markCellAsUnchanged();
2011-08-01 01:33:02 +00:00
void update (float duration, bool paused);
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.
void updateObjectLocalRotation (const Ptr& ptr);
void updateObjectRotation (const Ptr& ptr);
bool isCellActive(const CellStore &cell);
2014-04-29 13:27:49 +00:00
2014-04-29 13:32:00 +00:00
Ptr searchPtrViaHandle (const std::string& handle);
2014-04-29 13:27:49 +00:00
Ptr searchPtrViaActorId (int actorId);
2011-08-01 01:33:02 +00:00
};
}
#endif