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

94 lines
3.1 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-14 04:49:03 +00:00
#include <components/nif/property.hpp>
#include <components/nif/controller.hpp>
#include <components/nif/extra.hpp>
2012-04-08 02:02:20 +00:00
#include <utility>
#include "../mwworld/refdata.hpp"
#include "../mwworld/ptr.hpp"
#include "../mwworld/environment.hpp"
#include "components/nifogre/ogre_nif_loader.hpp"
2012-04-08 02:02:20 +00:00
#include "../mwworld/inventorystore.hpp"
2012-04-08 21:27:56 +00:00
#include "../mwclass/npc.hpp"
#include "../mwworld/containerstore.hpp"
2012-04-12 00:16:22 +00:00
#include "components/esm/loadarmo.hpp"
namespace MWRender{
class NpcAnimation: public Animation{
2012-04-05 03:23:24 +00:00
private:
2012-04-08 02:02:20 +00:00
MWWorld::InventoryStore& inv;
2012-04-05 03:23:24 +00:00
int mStateID;
//Free Parts
2012-04-08 02:02:20 +00: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-12 00:16:22 +00:00
int partslots[27]; //Each part slot is taken by clothing, armor, or is empty
2012-04-13 00:40:11 +00:00
int partpriorities[27];
std::pair<Ogre::Entity*, std::vector<Nif::NiTriShapeCopy>*> zero;
2012-04-12 00:16:22 +00:00
2012-04-05 03:23:24 +00: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-13 00:40:11 +00:00
2012-04-08 02:02:20 +00:00
Ogre::SceneNode* insert;
2012-04-08 21:27:56 +00:00
bool isBeast;
2012-04-14 22:58:52 +00:00
bool isFemale;
2012-04-08 21:27:56 +00:00
std::string headID;
std::string hairID;
std::string npcName;
std::string bodyRaceID;
2012-04-12 00:16:22 +00:00
float timeToChange;
MWWorld::ContainerStoreIterator robe;
2012-04-14 03:25:15 +00:00
MWWorld::ContainerStoreIterator helmet;
2012-04-14 20:44:46 +00:00
MWWorld::ContainerStoreIterator shirt;
MWWorld::ContainerStoreIterator cuirass;
2012-04-14 22:58:52 +00:00
MWWorld::ContainerStoreIterator greaves;
2012-04-14 23:21:14 +00:00
MWWorld::ContainerStoreIterator leftpauldron;
MWWorld::ContainerStoreIterator rightpauldron;
public:
2012-04-08 02:02:20 +00: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-08 02:02:20 +00: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 21:27:56 +00:00
void updateParts();
2012-04-13 00:40:11 +00:00
void removeIndividualPart(int type);
2012-04-14 22:58:52 +00:00
2012-04-13 02:16:02 +00:00
bool addOrReplaceIndividualPart(int type, int group, int priority, const std::string &mesh);
2012-04-14 22:58:52 +00:00
void removePartGroup(int group);
void addPartGroup(int group, int priority, std::vector<ESM::PartReference>& parts);
};
}
#endif