1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 06:35:30 +00:00
OpenMW/apps/openmw/mwrender/npcanimation.hpp

83 lines
2.6 KiB
C++
Raw Normal View History

#ifndef _GAME_RENDER_NPCANIMATION_H
#define _GAME_RENDER_NPCANIMATION_H
#include "animation.hpp"
#include <components/nif/data.hpp>
#include <components/nif/node.hpp>
2011-12-13 23:49:03 -05:00
#include <components/nif/property.hpp>
#include <components/nif/controller.hpp>
#include <components/nif/extra.hpp>
2012-04-07 22:02:20 -04:00
#include <utility>
#include "../mwworld/refdata.hpp"
#include "../mwworld/ptr.hpp"
#include "../mwworld/environment.hpp"
#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"
2012-04-11 20:16:22 -04:00
#include "components/esm/loadarmo.hpp"
namespace MWRender{
class NpcAnimation: public Animation{
2012-04-04 23:23:24 -04:00
private:
2012-04-07 22:02:20 -04:00
MWWorld::InventoryStore& inv;
2012-04-04 23:23:24 -04:00
int mStateID;
//Free Parts
2012-04-07 22:02:20 -04:00
std::pair<Ogre::Entity*, std::vector<Nif::NiTriShapeCopy>*> chest;
std::pair<Ogre::Entity*, std::vector<Nif::NiTriShapeCopy>*> skirt;
std::pair<Ogre::Entity*, std::vector<Nif::NiTriShapeCopy>*> lhand;
std::pair<Ogre::Entity*, std::vector<Nif::NiTriShapeCopy>*> rhand;
std::pair<Ogre::Entity*, std::vector<Nif::NiTriShapeCopy>*> tail;
std::pair<Ogre::Entity*, std::vector<Nif::NiTriShapeCopy>*> lBeastFoot;
std::pair<Ogre::Entity*, std::vector<Nif::NiTriShapeCopy>*> rBeastFoot;
2012-04-11 20:16:22 -04:00
int partslots[27]; //Each part slot is taken by clothing, armor, or is empty
2012-04-12 20:40:11 -04:00
int partpriorities[27];
std::pair<Ogre::Entity*, std::vector<Nif::NiTriShapeCopy>*> zero;
2012-04-11 20:16:22 -04:00
2012-04-04 23:23:24 -04:00
//Bounded Parts
Ogre::Entity* lclavicle;
Ogre::Entity* rclavicle;
Ogre::Entity* rupperArm;
Ogre::Entity* lupperArm;
Ogre::Entity* rUpperLeg;
Ogre::Entity* lUpperLeg;
Ogre::Entity* lForearm;
Ogre::Entity* rForearm;
Ogre::Entity* lWrist;
Ogre::Entity* rWrist;
Ogre::Entity* rKnee;
Ogre::Entity* lKnee;
Ogre::Entity* neck;
Ogre::Entity* rAnkle;
Ogre::Entity* lAnkle;
Ogre::Entity* groin;
Ogre::Entity* lfoot;
Ogre::Entity* rfoot;
Ogre::Entity* hair;
Ogre::Entity* head;
2012-04-12 20:40:11 -04:00
2012-04-07 22:02:20 -04:00
Ogre::SceneNode* insert;
2012-04-08 17:27:56 -04:00
bool isBeast;
std::string headID;
std::string hairID;
std::string npcName;
std::string bodyRaceID;
2012-04-11 20:16:22 -04:00
float timeToChange;
MWWorld::ContainerStoreIterator robe;
public:
2012-04-07 22:02:20 -04:00
NpcAnimation(const MWWorld::Ptr& ptr, MWWorld::Environment& _env, OEngine::Render::OgreRenderer& _rend, MWWorld::InventoryStore& _inv);
virtual ~NpcAnimation();
Ogre::Entity* insertBoundedPart(const std::string &mesh, std::string bonename);
2012-04-07 22:02:20 -04:00
std::pair<Ogre::Entity*, std::vector<Nif::NiTriShapeCopy>*> insertFreePart(const std::string &mesh, const std::string suffix);
virtual void runAnimation(float timepassed);
2012-04-08 17:27:56 -04:00
void updateParts();
2012-04-12 20:40:11 -04:00
void removeIndividualPart(int type);
};
}
#endif