2011-11-24 06:48:54 +00:00
|
|
|
#ifndef _GAME_RENDER_ACTORS_H
|
|
|
|
#define _GAME_RENDER_ACTORS_H
|
|
|
|
|
2011-12-12 03:40:00 +00:00
|
|
|
#include "npcanimation.hpp"
|
|
|
|
#include "creatureanimation.hpp"
|
2011-12-09 08:02:09 +00:00
|
|
|
|
2012-07-03 11:55:53 +00:00
|
|
|
namespace MWWorld
|
|
|
|
{
|
|
|
|
class Ptr;
|
|
|
|
class CellStore;
|
|
|
|
}
|
|
|
|
|
2011-11-24 06:48:54 +00:00
|
|
|
namespace MWRender{
|
|
|
|
class Actors{
|
|
|
|
OEngine::Render::OgreRenderer &mRend;
|
2012-07-03 11:55:53 +00:00
|
|
|
std::map<MWWorld::CellStore *, Ogre::SceneNode *> mCellSceneNodes;
|
2011-11-24 06:48:54 +00:00
|
|
|
Ogre::SceneNode* mMwRoot;
|
2011-12-25 02:53:12 +00:00
|
|
|
std::map<MWWorld::Ptr, Animation*> mAllActors;
|
2011-11-25 04:13:34 +00:00
|
|
|
|
2012-01-23 13:33:06 +00:00
|
|
|
|
2011-11-24 06:48:54 +00:00
|
|
|
|
|
|
|
public:
|
2012-04-23 13:27:03 +00:00
|
|
|
Actors(OEngine::Render::OgreRenderer& _rend): mRend(_rend) {}
|
2012-03-26 22:31:15 +00:00
|
|
|
~Actors();
|
2011-11-25 04:13:34 +00:00
|
|
|
void setMwRoot(Ogre::SceneNode* root);
|
|
|
|
void insertBegin (const MWWorld::Ptr& ptr, bool enabled, bool static_);
|
2011-12-12 03:40:00 +00:00
|
|
|
void insertCreature (const MWWorld::Ptr& ptr);
|
2012-04-08 02:02:20 +00:00
|
|
|
void insertNPC(const MWWorld::Ptr& ptr, MWWorld::InventoryStore& inv);
|
2011-11-25 04:13:34 +00:00
|
|
|
bool deleteObject (const MWWorld::Ptr& ptr);
|
|
|
|
///< \return found?
|
|
|
|
|
2012-07-03 11:55:53 +00:00
|
|
|
void removeCell(MWWorld::CellStore* store);
|
2011-12-27 00:23:46 +00:00
|
|
|
|
|
|
|
void playAnimationGroup (const MWWorld::Ptr& ptr, const std::string& groupName, int mode,
|
|
|
|
int number = 1);
|
|
|
|
///< Run animation for a MW-reference. Calls to this function for references that are currently not
|
|
|
|
/// in the rendered scene should be ignored.
|
|
|
|
///
|
|
|
|
/// \param mode: 0 normal, 1 immediate start, 2 immediate loop
|
|
|
|
/// \param number How offen the animation should be run
|
|
|
|
|
|
|
|
void skipAnimation (const MWWorld::Ptr& ptr);
|
|
|
|
///< Skip the animation for the given MW-reference for one frame. Calls to this function for
|
|
|
|
/// references that are currently not in the rendered scene should be ignored.
|
|
|
|
|
2012-01-23 13:33:06 +00:00
|
|
|
void update (float duration);
|
|
|
|
|
2012-07-30 19:28:14 +00:00
|
|
|
void updateObjectCell(const MWWorld::Ptr &ptr);
|
2011-11-24 06:48:54 +00:00
|
|
|
};
|
|
|
|
}
|
2012-01-23 13:33:06 +00:00
|
|
|
#endif
|