2011-11-24 06:48:54 +00:00
|
|
|
#ifndef _GAME_RENDER_NPCANIMATION_H
|
|
|
|
#define _GAME_RENDER_NPCANIMATION_H
|
2012-07-17 07:27:12 +00:00
|
|
|
|
2011-11-24 06:48:54 +00:00
|
|
|
#include "animation.hpp"
|
2011-12-12 03:40:00 +00:00
|
|
|
|
2012-04-08 02:02:20 +00:00
|
|
|
#include "../mwworld/inventorystore.hpp"
|
2012-04-08 21:27:56 +00:00
|
|
|
#include "../mwworld/containerstore.hpp"
|
2011-12-12 03:40:00 +00:00
|
|
|
|
2012-11-08 09:46:24 +00:00
|
|
|
namespace ESM
|
|
|
|
{
|
|
|
|
struct NPC;
|
|
|
|
}
|
|
|
|
|
2013-01-06 05:12:08 +00:00
|
|
|
namespace MWRender
|
|
|
|
{
|
2011-11-24 06:48:54 +00:00
|
|
|
|
2013-01-06 13:39:39 +00:00
|
|
|
class NpcAnimation : public Animation
|
|
|
|
{
|
|
|
|
public:
|
2013-01-06 09:59:18 +00:00
|
|
|
struct PartInfo {
|
|
|
|
ESM::PartReferenceType type;
|
|
|
|
NifOgre::EntityList NpcAnimation::*ents;
|
|
|
|
const char name[32];
|
|
|
|
};
|
|
|
|
|
2012-04-05 03:23:24 +00:00
|
|
|
private:
|
2013-01-06 13:39:39 +00:00
|
|
|
static const size_t sPartListSize = 27;
|
|
|
|
static const PartInfo sPartList[sPartListSize];
|
|
|
|
|
2012-07-13 10:51:58 +00:00
|
|
|
MWWorld::InventoryStore& mInv;
|
2012-07-13 03:12:18 +00:00
|
|
|
int mStateID;
|
2012-04-12 00:16:22 +00:00
|
|
|
|
2012-07-13 03:12:18 +00:00
|
|
|
//Bounded Parts
|
2012-11-08 09:46:24 +00:00
|
|
|
NifOgre::EntityList mClavicleL;
|
|
|
|
NifOgre::EntityList mClavicleR;
|
|
|
|
NifOgre::EntityList mUpperArmL;
|
|
|
|
NifOgre::EntityList mUpperArmR;
|
|
|
|
NifOgre::EntityList mUpperLegL;
|
|
|
|
NifOgre::EntityList mUpperLegR;
|
|
|
|
NifOgre::EntityList mForearmL;
|
|
|
|
NifOgre::EntityList mForearmR;
|
|
|
|
NifOgre::EntityList mWristL;
|
|
|
|
NifOgre::EntityList mWristR;
|
|
|
|
NifOgre::EntityList mKneeR;
|
|
|
|
NifOgre::EntityList mKneeL;
|
|
|
|
NifOgre::EntityList mNeck;
|
|
|
|
NifOgre::EntityList mAnkleL;
|
|
|
|
NifOgre::EntityList mAnkleR;
|
|
|
|
NifOgre::EntityList mGroin;
|
|
|
|
NifOgre::EntityList mSkirt;
|
|
|
|
NifOgre::EntityList mFootL;
|
|
|
|
NifOgre::EntityList mFootR;
|
|
|
|
NifOgre::EntityList mHair;
|
|
|
|
NifOgre::EntityList mHandL;
|
|
|
|
NifOgre::EntityList mHandR;
|
2013-01-06 13:39:39 +00:00
|
|
|
NifOgre::EntityList mShield;
|
|
|
|
NifOgre::EntityList mWeapon;
|
2012-11-08 09:46:24 +00:00
|
|
|
NifOgre::EntityList mHead;
|
|
|
|
NifOgre::EntityList mChest;
|
|
|
|
NifOgre::EntityList mTail;
|
|
|
|
|
|
|
|
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 13:27:03 +00:00
|
|
|
|
2012-09-13 17:03:31 +00:00
|
|
|
int mVisibilityFlags;
|
|
|
|
|
2013-01-06 13:39:39 +00:00
|
|
|
int mPartslots[sPartListSize]; //Each part slot is taken by clothing, armor, or is empty
|
|
|
|
int mPartPriorities[sPartListSize];
|
2013-01-06 09:59:18 +00:00
|
|
|
|
2012-07-13 03:12:18 +00:00
|
|
|
public:
|
2012-09-14 22:57:29 +00:00
|
|
|
NpcAnimation(const MWWorld::Ptr& ptr, Ogre::SceneNode* node,
|
2012-11-08 09:46:24 +00:00
|
|
|
MWWorld::InventoryStore& inv, int visibilityFlags);
|
2012-07-13 03:12:18 +00:00
|
|
|
virtual ~NpcAnimation();
|
2012-09-14 12:34:18 +00:00
|
|
|
NifOgre::EntityList insertBoundedPart(const std::string &mesh, int group, const std::string &bonename);
|
2012-07-13 03:12:18 +00:00
|
|
|
virtual void runAnimation(float timepassed);
|
|
|
|
void updateParts();
|
2012-07-18 17:26:25 +00:00
|
|
|
void removeEntities(NifOgre::EntityList &entities);
|
2012-04-13 00:40:11 +00:00
|
|
|
void removeIndividualPart(int type);
|
2012-04-15 19:16:48 +00:00
|
|
|
void reserveIndividualPart(int type, int group, int priority);
|
2012-04-23 13:27:03 +00:00
|
|
|
|
2012-04-13 02:16:02 +00:00
|
|
|
bool addOrReplaceIndividualPart(int type, int group, int priority, const std::string &mesh);
|
2012-07-13 03:12:18 +00:00
|
|
|
void removePartGroup(int group);
|
2012-04-14 22:58:52 +00:00
|
|
|
void addPartGroup(int group, int priority, std::vector<ESM::PartReference>& parts);
|
2012-09-13 17:03:31 +00:00
|
|
|
|
|
|
|
void forceUpdate();
|
2011-11-24 06:48:54 +00:00
|
|
|
};
|
2012-07-13 03:12:18 +00:00
|
|
|
|
2011-11-24 06:48:54 +00:00
|
|
|
}
|
2013-01-06 05:12:08 +00:00
|
|
|
|
2012-04-23 13:27:03 +00:00
|
|
|
#endif
|