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
|
|
|
|
|
|
|
#include "components/nifogre/ogre_nif_loader.hpp"
|
2012-04-07 22:02:20 -04:00
|
|
|
#include "../mwworld/inventorystore.hpp"
|
2012-04-08 17:27:56 -04:00
|
|
|
#include "../mwclass/npc.hpp"
|
|
|
|
#include "../mwworld/containerstore.hpp"
|
2011-12-11 22:40:00 -05:00
|
|
|
|
2011-11-24 01:48:54 -05:00
|
|
|
namespace MWRender{
|
|
|
|
|
2011-12-11 22:40:00 -05:00
|
|
|
class NpcAnimation: public Animation{
|
2012-04-04 23:23:24 -04:00
|
|
|
private:
|
2012-07-13 03:51:58 -07:00
|
|
|
MWWorld::InventoryStore& mInv;
|
2012-07-12 20:12:18 -07:00
|
|
|
int mStateID;
|
2012-04-11 20:16:22 -04:00
|
|
|
|
2012-07-17 10:57:15 -07:00
|
|
|
int mPartslots[27]; //Each part slot is taken by clothing, armor, or is empty
|
|
|
|
int mPartPriorities[27];
|
2012-04-11 20:16:22 -04:00
|
|
|
|
2012-07-12 20:12:18 -07:00
|
|
|
//Bounded Parts
|
2012-07-17 12:19:50 -07:00
|
|
|
std::vector<Ogre::Entity*> lclavicle;
|
|
|
|
std::vector<Ogre::Entity*> rclavicle;
|
|
|
|
std::vector<Ogre::Entity*> rupperArm;
|
|
|
|
std::vector<Ogre::Entity*> lupperArm;
|
|
|
|
std::vector<Ogre::Entity*> rUpperLeg;
|
|
|
|
std::vector<Ogre::Entity*> lUpperLeg;
|
|
|
|
std::vector<Ogre::Entity*> lForearm;
|
|
|
|
std::vector<Ogre::Entity*> rForearm;
|
|
|
|
std::vector<Ogre::Entity*> lWrist;
|
|
|
|
std::vector<Ogre::Entity*> rWrist;
|
|
|
|
std::vector<Ogre::Entity*> rKnee;
|
|
|
|
std::vector<Ogre::Entity*> lKnee;
|
|
|
|
std::vector<Ogre::Entity*> neck;
|
|
|
|
std::vector<Ogre::Entity*> rAnkle;
|
|
|
|
std::vector<Ogre::Entity*> lAnkle;
|
|
|
|
std::vector<Ogre::Entity*> groin;
|
|
|
|
std::vector<Ogre::Entity*> lfoot;
|
|
|
|
std::vector<Ogre::Entity*> rfoot;
|
|
|
|
std::vector<Ogre::Entity*> hair;
|
|
|
|
std::vector<Ogre::Entity*> head;
|
2012-04-23 15:27:03 +02:00
|
|
|
|
2012-04-08 17:27:56 -04:00
|
|
|
bool isBeast;
|
2012-04-14 18:58:52 -04:00
|
|
|
bool isFemale;
|
2012-07-12 20:12:18 -07:00
|
|
|
std::string headModel;
|
|
|
|
std::string hairModel;
|
|
|
|
std::string npcName;
|
|
|
|
std::string bodyRaceID;
|
|
|
|
float timeToChange;
|
|
|
|
MWWorld::ContainerStoreIterator robe;
|
2012-04-13 23:25:15 -04:00
|
|
|
MWWorld::ContainerStoreIterator helmet;
|
2012-04-14 16:44:46 -04:00
|
|
|
MWWorld::ContainerStoreIterator shirt;
|
|
|
|
MWWorld::ContainerStoreIterator cuirass;
|
2012-04-14 18:58:52 -04:00
|
|
|
MWWorld::ContainerStoreIterator greaves;
|
2012-04-14 19:21:14 -04:00
|
|
|
MWWorld::ContainerStoreIterator leftpauldron;
|
|
|
|
MWWorld::ContainerStoreIterator rightpauldron;
|
2012-04-14 20:32:46 -04:00
|
|
|
MWWorld::ContainerStoreIterator boots;
|
|
|
|
MWWorld::ContainerStoreIterator pants;
|
|
|
|
MWWorld::ContainerStoreIterator leftglove;
|
|
|
|
MWWorld::ContainerStoreIterator rightglove;
|
2012-04-15 15:16:48 -04:00
|
|
|
MWWorld::ContainerStoreIterator skirtiter;
|
2012-04-23 15:27:03 +02:00
|
|
|
|
2012-07-12 20:12:18 -07:00
|
|
|
public:
|
|
|
|
NpcAnimation(const MWWorld::Ptr& ptr, OEngine::Render::OgreRenderer& _rend, MWWorld::InventoryStore& _inv);
|
|
|
|
virtual ~NpcAnimation();
|
2012-07-17 12:19:50 -07:00
|
|
|
std::vector<Ogre::Entity*> insertBoundedPart(const std::string &mesh, const std::string &bonename);
|
2012-07-12 20:12:18 -07:00
|
|
|
virtual void runAnimation(float timepassed);
|
|
|
|
void updateParts();
|
2012-07-17 12:19:50 -07:00
|
|
|
void removeEntities(std::vector<Ogre::Entity*> &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);
|
2012-04-14 18:58:52 -04:00
|
|
|
void addPartGroup(int group, int priority, std::vector<ESM::PartReference>& parts);
|
2011-11-24 01:48:54 -05:00
|
|
|
};
|
2012-07-12 20:12:18 -07:00
|
|
|
|
2011-11-24 01:48:54 -05:00
|
|
|
}
|
2012-04-23 15:27:03 +02:00
|
|
|
#endif
|