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 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-02-23 16:03:52 +00:00
|
|
|
namespace MWWorld
|
|
|
|
{
|
|
|
|
class InventoryStore;
|
|
|
|
}
|
|
|
|
|
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-08-06 01:59:55 +00:00
|
|
|
typedef std::map<ESM::PartReferenceType,std::string> PartBoneMap;
|
2013-01-06 09:59:18 +00:00
|
|
|
|
2013-08-06 01:59:55 +00:00
|
|
|
enum ViewMode {
|
|
|
|
VM_Normal,
|
|
|
|
VM_FirstPerson,
|
|
|
|
VM_HeadOnly
|
|
|
|
};
|
2013-04-09 16:07:05 +00:00
|
|
|
|
2012-04-05 03:23:24 +00:00
|
|
|
private:
|
2013-08-06 01:59:55 +00:00
|
|
|
static const PartBoneMap sPartList;
|
2013-01-06 13:39:39 +00:00
|
|
|
|
2012-07-13 03:12:18 +00:00
|
|
|
int mStateID;
|
2012-04-12 00:16:22 +00:00
|
|
|
|
2013-02-02 10:53:22 +00:00
|
|
|
// Bounded Parts
|
2013-08-06 01:59:55 +00:00
|
|
|
NifOgre::ObjectList mObjectParts[ESM::PRT_Count];
|
2012-11-08 09:46:24 +00:00
|
|
|
|
2013-08-07 23:45:29 +00:00
|
|
|
const ESM::NPC *mNpc;
|
|
|
|
std::string mHeadModel;
|
|
|
|
std::string mHairModel;
|
|
|
|
ViewMode mViewMode;
|
2013-04-28 10:41:01 +00:00
|
|
|
bool mShowWeapons;
|
2012-11-08 09:46:24 +00:00
|
|
|
|
|
|
|
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;
|
2013-04-28 10:41:01 +00:00
|
|
|
MWWorld::ContainerStoreIterator mWeapon;
|
|
|
|
MWWorld::ContainerStoreIterator mShield;
|
2012-04-23 13:27:03 +00:00
|
|
|
|
2012-09-13 17:03:31 +00:00
|
|
|
int mVisibilityFlags;
|
|
|
|
|
2013-08-06 01:59:55 +00:00
|
|
|
int mPartslots[ESM::PRT_Count]; //Each part slot is taken by clothing, armor, or is empty
|
|
|
|
int mPartPriorities[ESM::PRT_Count];
|
2013-01-06 09:59:18 +00:00
|
|
|
|
2013-08-07 23:21:57 +00:00
|
|
|
void updateNpcBase();
|
|
|
|
|
2013-04-07 08:52:35 +00:00
|
|
|
NifOgre::ObjectList insertBoundedPart(const std::string &model, int group, const std::string &bonename);
|
2013-02-21 19:56:34 +00:00
|
|
|
|
2013-08-06 01:59:55 +00:00
|
|
|
void removeIndividualPart(ESM::PartReferenceType type);
|
|
|
|
void reserveIndividualPart(ESM::PartReferenceType type, int group, int priority);
|
2012-04-23 13:27:03 +00:00
|
|
|
|
2013-08-06 01:59:55 +00:00
|
|
|
bool addOrReplaceIndividualPart(ESM::PartReferenceType type, int group, int priority, const std::string &mesh);
|
2012-07-13 03:12:18 +00:00
|
|
|
void removePartGroup(int group);
|
2013-01-09 16:03:28 +00:00
|
|
|
void addPartGroup(int group, int priority, const std::vector<ESM::PartReference> &parts);
|
2012-09-13 17:03:31 +00:00
|
|
|
|
2013-01-09 15:55:55 +00:00
|
|
|
public:
|
|
|
|
NpcAnimation(const MWWorld::Ptr& ptr, Ogre::SceneNode* node,
|
2013-04-09 16:07:05 +00:00
|
|
|
MWWorld::InventoryStore& inv, int visibilityFlags,
|
|
|
|
ViewMode viewMode=VM_Normal);
|
2013-01-09 15:55:55 +00:00
|
|
|
virtual ~NpcAnimation();
|
|
|
|
|
2013-01-19 00:21:29 +00:00
|
|
|
virtual Ogre::Vector3 runAnimation(float timepassed);
|
2013-01-09 15:55:55 +00:00
|
|
|
|
2013-04-28 10:41:01 +00:00
|
|
|
virtual void showWeapons(bool showWeapon);
|
|
|
|
|
2013-04-09 22:10:14 +00:00
|
|
|
void setViewMode(ViewMode viewMode);
|
|
|
|
|
2013-08-08 22:37:08 +00:00
|
|
|
void updateParts(bool forceupdate = false);
|
2013-08-09 00:16:24 +00:00
|
|
|
|
|
|
|
/// Rebuilds the NPC, updating their root model, animation sources, and equipment.
|
|
|
|
void rebuild();
|
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
|