1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 09:49:55 +00:00
openmw-tes3mp/apps/openmw/mwrender/actors.hpp
Chris Robinson 1ce8eaf52c Merge remote-tracking branch 'zini/master' into animation2
Conflicts:
	apps/openmw/mwrender/actors.cpp
	apps/openmw/mwrender/actors.hpp
2013-01-16 07:36:56 -08:00

59 lines
1.8 KiB
C++

#ifndef _GAME_RENDER_ACTORS_H
#define _GAME_RENDER_ACTORS_H
#include <openengine/ogre/renderer.hpp>
namespace MWWorld
{
class Ptr;
class CellStore;
class InventoryStore;
}
namespace MWRender
{
class Animation;
class Actors
{
typedef std::map<MWWorld::CellStore*,Ogre::SceneNode*> CellSceneNodeMap;
typedef std::map<MWWorld::Ptr,Animation*> PtrAnimationMap;
OEngine::Render::OgreRenderer &mRend;
Ogre::SceneNode* mMwRoot;
CellSceneNodeMap mCellSceneNodes;
PtrAnimationMap mAllActors;
public:
Actors(OEngine::Render::OgreRenderer& _rend): mRend(_rend) {}
~Actors();
void setMwRoot(Ogre::SceneNode* root);
void insertBegin (const MWWorld::Ptr& ptr);
void insertCreature (const MWWorld::Ptr& ptr);
void insertNPC(const MWWorld::Ptr& ptr, MWWorld::InventoryStore& inv);
bool deleteObject (const MWWorld::Ptr& ptr);
///< \return found?
void removeCell(MWWorld::CellStore* store);
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.
void update (float duration);
/// Updates containing cell for object rendering data
void updateObjectCell(const MWWorld::Ptr &ptr);
};
}
#endif