2014-01-05 18:22:29 +01:00
|
|
|
#ifndef GAME_RENDER_ACTORS_H
|
|
|
|
#define GAME_RENDER_ACTORS_H
|
2011-11-24 01:48:54 -05:00
|
|
|
|
2013-01-05 21:12:08 -08:00
|
|
|
#include <openengine/ogre/renderer.hpp>
|
2011-12-09 03:02:09 -05:00
|
|
|
|
2012-07-03 13:55:53 +02:00
|
|
|
namespace MWWorld
|
|
|
|
{
|
|
|
|
class Ptr;
|
|
|
|
class CellStore;
|
2013-01-05 21:12:08 -08:00
|
|
|
class InventoryStore;
|
2012-07-03 13:55:53 +02:00
|
|
|
}
|
|
|
|
|
2013-01-05 21:12:08 -08:00
|
|
|
namespace MWRender
|
|
|
|
{
|
|
|
|
class Animation;
|
2013-02-27 09:20:42 +01:00
|
|
|
class RenderingManager;
|
2013-01-05 21:12:08 -08:00
|
|
|
|
|
|
|
class Actors
|
|
|
|
{
|
2013-01-15 11:10:41 -08:00
|
|
|
typedef std::map<MWWorld::CellStore*,Ogre::SceneNode*> CellSceneNodeMap;
|
|
|
|
typedef std::map<MWWorld::Ptr,Animation*> PtrAnimationMap;
|
|
|
|
|
2011-11-24 01:48:54 -05:00
|
|
|
OEngine::Render::OgreRenderer &mRend;
|
2013-02-27 09:20:42 +01:00
|
|
|
MWRender::RenderingManager* mRendering;
|
2013-02-26 14:01:10 +01:00
|
|
|
Ogre::SceneNode* mRootNode;
|
2013-01-16 07:30:36 -08:00
|
|
|
|
2013-01-15 11:10:41 -08:00
|
|
|
CellSceneNodeMap mCellSceneNodes;
|
|
|
|
PtrAnimationMap mAllActors;
|
2011-11-24 23:13:34 -05:00
|
|
|
|
2013-08-07 03:51:57 -07:00
|
|
|
void insertBegin(const MWWorld::Ptr &ptr);
|
|
|
|
|
2013-01-05 21:12:08 -08:00
|
|
|
public:
|
2013-02-27 09:20:42 +01:00
|
|
|
Actors(OEngine::Render::OgreRenderer& _rend, MWRender::RenderingManager* rendering)
|
|
|
|
: mRend(_rend)
|
|
|
|
, mRendering(rendering)
|
2013-07-31 18:46:32 +02:00
|
|
|
, mRootNode(NULL)
|
2013-02-27 09:20:42 +01:00
|
|
|
{}
|
2012-03-27 00:31:15 +02:00
|
|
|
~Actors();
|
2013-01-15 11:10:41 -08:00
|
|
|
|
2013-02-26 14:01:10 +01:00
|
|
|
void setRootNode(Ogre::SceneNode* root);
|
2013-08-07 03:51:57 -07:00
|
|
|
|
2013-11-14 14:41:10 +01:00
|
|
|
void insertNPC(const MWWorld::Ptr& ptr);
|
2014-01-19 13:05:26 +01:00
|
|
|
void insertCreature (const MWWorld::Ptr& ptr, bool weaponsShields);
|
2013-01-16 14:37:32 -08:00
|
|
|
void insertActivator (const MWWorld::Ptr& ptr);
|
2011-11-24 23:13:34 -05:00
|
|
|
bool deleteObject (const MWWorld::Ptr& ptr);
|
|
|
|
///< \return found?
|
|
|
|
|
2012-07-03 13:55:53 +02:00
|
|
|
void removeCell(MWWorld::CellStore* store);
|
2011-12-26 19:23:46 -05:00
|
|
|
|
2013-12-26 18:16:28 +01:00
|
|
|
void update (Ogre::Camera* camera);
|
2012-01-23 14:33:06 +01:00
|
|
|
|
2012-07-31 16:52:21 +04:00
|
|
|
/// Updates containing cell for object rendering data
|
2013-02-24 14:59:21 +04:00
|
|
|
void updateObjectCell(const MWWorld::Ptr &old, const MWWorld::Ptr &cur);
|
2013-01-16 09:59:19 -08:00
|
|
|
|
|
|
|
Animation* getAnimation(const MWWorld::Ptr &ptr);
|
2011-11-24 01:48:54 -05:00
|
|
|
};
|
|
|
|
}
|
2012-01-23 14:33:06 +01:00
|
|
|
#endif
|