2011-11-24 01:48:54 -05:00
|
|
|
#ifndef _GAME_RENDER_NPCANIMATION_H
|
|
|
|
#define _GAME_RENDER_NPCANIMATION_H
|
2012-07-17 09:27:12 +02:00
|
|
|
|
2011-11-24 01:48:54 -05:00
|
|
|
#include "animation.hpp"
|
2011-12-11 22:40:00 -05:00
|
|
|
|
2012-04-08 17:27:56 -04:00
|
|
|
#include "../mwworld/containerstore.hpp"
|
2011-12-11 22:40:00 -05:00
|
|
|
|
2012-11-08 13:46:24 +04:00
|
|
|
namespace ESM
|
|
|
|
{
|
|
|
|
struct NPC;
|
|
|
|
}
|
|
|
|
|
2013-02-23 08:03:52 -08:00
|
|
|
namespace MWWorld
|
|
|
|
{
|
|
|
|
class InventoryStore;
|
|
|
|
}
|
|
|
|
|
2013-01-05 21:12:08 -08:00
|
|
|
namespace MWRender
|
|
|
|
{
|
2011-11-24 01:48:54 -05:00
|
|
|
|
2013-01-06 05:39:39 -08:00
|
|
|
class NpcAnimation : public Animation
|
|
|
|
{
|
|
|
|
public:
|
2013-01-06 01:59:18 -08:00
|
|
|
struct PartInfo {
|
|
|
|
ESM::PartReferenceType type;
|
|
|
|
const char name[32];
|
|
|
|
};
|
|
|
|
|
2012-04-04 23:23:24 -04:00
|
|
|
private:
|
2013-01-06 05:39:39 -08:00
|
|
|
static const size_t sPartListSize = 27;
|
|
|
|
static const PartInfo sPartList[sPartListSize];
|
|
|
|
|
2012-07-12 20:12:18 -07:00
|
|
|
int mStateID;
|
2012-04-11 20:16:22 -04:00
|
|
|
|
2013-02-02 02:53:22 -08:00
|
|
|
// Bounded Parts
|
|
|
|
NifOgre::EntityList mEntityParts[sPartListSize];
|
2012-11-08 13:46:24 +04:00
|
|
|
|
|
|
|
const ESM::NPC *mNpc;
|
|
|
|
std::string mHeadModel;
|
|
|
|
std::string mHairModel;
|
|
|
|
std::string mBodyPrefix;
|
|
|
|
|
|
|
|
float mTimeToChange;
|
|
|
|
MWWorld::ContainerStoreIterator mRobe;
|
|
|
|
MWWorld::ContainerStoreIterator mHelmet;
|
|
|
|
MWWorld::ContainerStoreIterator mShirt;
|
|
|
|
MWWorld::ContainerStoreIterator mCuirass;
|
|
|
|
MWWorld::ContainerStoreIterator mGreaves;
|
|
|
|
MWWorld::ContainerStoreIterator mPauldronL;
|
|
|
|
MWWorld::ContainerStoreIterator mPauldronR;
|
|
|
|
MWWorld::ContainerStoreIterator mBoots;
|
|
|
|
MWWorld::ContainerStoreIterator mPants;
|
|
|
|
MWWorld::ContainerStoreIterator mGloveL;
|
|
|
|
MWWorld::ContainerStoreIterator mGloveR;
|
|
|
|
MWWorld::ContainerStoreIterator mSkirtIter;
|
2012-04-23 15:27:03 +02:00
|
|
|
|
2012-09-13 19:03:31 +02:00
|
|
|
int mVisibilityFlags;
|
|
|
|
|
2013-01-06 05:39:39 -08:00
|
|
|
int mPartslots[sPartListSize]; //Each part slot is taken by clothing, armor, or is empty
|
|
|
|
int mPartPriorities[sPartListSize];
|
2013-01-06 01:59:18 -08:00
|
|
|
|
2012-09-14 14:34:18 +02:00
|
|
|
NifOgre::EntityList insertBoundedPart(const std::string &mesh, int group, const std::string &bonename);
|
2013-02-21 23:56:34 +04:00
|
|
|
|
2013-02-22 10:15:29 -08:00
|
|
|
void updateParts(bool forceupdate = false);
|
2013-02-21 23:56:34 +04:00
|
|
|
|
2012-07-18 10:26:25 -07:00
|
|
|
void removeEntities(NifOgre::EntityList &entities);
|
2012-04-12 20:40:11 -04:00
|
|
|
void removeIndividualPart(int type);
|
2012-04-15 15:16:48 -04:00
|
|
|
void reserveIndividualPart(int type, int group, int priority);
|
2012-04-23 15:27:03 +02:00
|
|
|
|
2012-04-12 22:16:02 -04:00
|
|
|
bool addOrReplaceIndividualPart(int type, int group, int priority, const std::string &mesh);
|
2012-07-12 20:12:18 -07:00
|
|
|
void removePartGroup(int group);
|
2013-01-09 08:03:28 -08:00
|
|
|
void addPartGroup(int group, int priority, const std::vector<ESM::PartReference> &parts);
|
2012-09-13 19:03:31 +02:00
|
|
|
|
2013-01-09 07:55:55 -08:00
|
|
|
public:
|
|
|
|
NpcAnimation(const MWWorld::Ptr& ptr, Ogre::SceneNode* node,
|
|
|
|
MWWorld::InventoryStore& inv, int visibilityFlags);
|
|
|
|
virtual ~NpcAnimation();
|
|
|
|
|
2013-01-18 16:21:29 -08:00
|
|
|
virtual Ogre::Vector3 runAnimation(float timepassed);
|
2013-01-09 07:55:55 -08:00
|
|
|
|
2013-02-22 10:15:29 -08:00
|
|
|
void forceUpdate()
|
|
|
|
{ updateParts(true); }
|
2011-11-24 01:48:54 -05:00
|
|
|
};
|
2012-07-12 20:12:18 -07:00
|
|
|
|
2011-11-24 01:48:54 -05:00
|
|
|
}
|
2013-01-05 21:12:08 -08:00
|
|
|
|
2012-04-23 15:27:03 +02:00
|
|
|
#endif
|