1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 07:19:54 +00:00
openmw-tes3mp/apps/openmw/mwrender/npcanimation.hpp

102 lines
2.5 KiB
C++
Raw Normal View History

#ifndef _GAME_RENDER_NPCANIMATION_H
#define _GAME_RENDER_NPCANIMATION_H
#include "animation.hpp"
2012-04-08 21:27:56 +00:00
#include "../mwworld/containerstore.hpp"
2012-11-08 09:46:24 +00:00
namespace ESM
{
struct NPC;
}
namespace MWWorld
{
class InventoryStore;
}
namespace MWRender
{
2013-01-06 13:39:39 +00:00
class NpcAnimation : public Animation
{
public:
struct PartInfo {
ESM::PartReferenceType type;
const char name[32];
};
enum ViewMode {
VM_Normal,
VM_FirstPerson,
VM_HeadOnly
};
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];
int mStateID;
2012-04-12 00:16:22 +00:00
2013-02-02 10:53:22 +00:00
// Bounded Parts
2013-04-07 08:52:35 +00:00
NifOgre::ObjectList mObjectParts[sPartListSize];
2012-11-08 09:46:24 +00:00
const ESM::NPC *mNpc;
std::string mHeadModel;
std::string mHairModel;
std::string mBodyPrefix;
ViewMode mViewMode;
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;
MWWorld::ContainerStoreIterator mWeapon;
MWWorld::ContainerStoreIterator mShield;
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-04-07 08:52:35 +00:00
NifOgre::ObjectList insertBoundedPart(const std::string &model, int group, const std::string &bonename);
2013-02-22 18:15:29 +00:00
void updateParts(bool forceupdate = false);
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-13 02:16:02 +00:00
bool addOrReplaceIndividualPart(int type, int group, int priority, const std::string &mesh);
void removePartGroup(int group);
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,
MWWorld::InventoryStore& inv, int visibilityFlags,
ViewMode viewMode=VM_Normal);
2013-01-09 15:55:55 +00:00
virtual ~NpcAnimation();
virtual Ogre::Vector3 runAnimation(float timepassed);
2013-01-09 15:55:55 +00:00
virtual void showWeapons(bool showWeapon);
void setViewMode(ViewMode viewMode);
2013-02-22 18:15:29 +00:00
void forceUpdate()
{ updateParts(true); }
};
}
#endif