forked from teamnwah/openmw-tes3coop
Store the entity lists for NPC parts
This commit is contained in:
parent
6611b0b317
commit
04e496a6ca
2 changed files with 33 additions and 29 deletions
|
@ -339,13 +339,13 @@ void NpcAnimation::updateParts()
|
|||
}
|
||||
}
|
||||
|
||||
std::vector<Ogre::Entity*> NpcAnimation::insertBoundedPart(const std::string &mesh, const std::string &bonename)
|
||||
NifOgre::EntityList NpcAnimation::insertBoundedPart(const std::string &mesh, const std::string &bonename)
|
||||
{
|
||||
NifOgre::EntityList entities = NIFLoader::createEntities(mInsert, mesh);
|
||||
std::vector<Ogre::Entity*> &parts = entities.mEntities;
|
||||
for(size_t i = 0;i < parts.size();i++)
|
||||
parts[i]->setVisibilityFlags(RV_Actors);
|
||||
return parts;
|
||||
return entities;
|
||||
}
|
||||
|
||||
void NpcAnimation::runAnimation(float timepassed)
|
||||
|
@ -379,15 +379,19 @@ void NpcAnimation::runAnimation(float timepassed)
|
|||
}
|
||||
}
|
||||
|
||||
void NpcAnimation::removeEntities(std::vector<Ogre::Entity*> &entities)
|
||||
void NpcAnimation::removeEntities(NifOgre::EntityList &entities)
|
||||
{
|
||||
assert(&entities != &mEntityList);
|
||||
|
||||
Ogre::SceneManager *sceneMgr = mInsert->getCreator();
|
||||
for(size_t i = 0;i < entities.size();i++)
|
||||
for(size_t i = 0;i < entities.mEntities.size();i++)
|
||||
{
|
||||
mEntityList.mSkelBase->detachObjectFromBone(entities[i]);
|
||||
sceneMgr->destroyEntity(entities[i]);
|
||||
mEntityList.mSkelBase->detachObjectFromBone(entities.mEntities[i]);
|
||||
sceneMgr->destroyEntity(entities.mEntities[i]);
|
||||
}
|
||||
entities.clear();
|
||||
entities.mEntities.clear();
|
||||
entities.mSkelBase = NULL;
|
||||
entities.mRootNode = NULL;
|
||||
}
|
||||
|
||||
void NpcAnimation::removeIndividualPart(int type)
|
||||
|
|
|
@ -19,26 +19,26 @@ private:
|
|||
int mPartPriorities[27];
|
||||
|
||||
//Bounded Parts
|
||||
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;
|
||||
NifOgre::EntityList lclavicle;
|
||||
NifOgre::EntityList rclavicle;
|
||||
NifOgre::EntityList rupperArm;
|
||||
NifOgre::EntityList lupperArm;
|
||||
NifOgre::EntityList rUpperLeg;
|
||||
NifOgre::EntityList lUpperLeg;
|
||||
NifOgre::EntityList lForearm;
|
||||
NifOgre::EntityList rForearm;
|
||||
NifOgre::EntityList lWrist;
|
||||
NifOgre::EntityList rWrist;
|
||||
NifOgre::EntityList rKnee;
|
||||
NifOgre::EntityList lKnee;
|
||||
NifOgre::EntityList neck;
|
||||
NifOgre::EntityList rAnkle;
|
||||
NifOgre::EntityList lAnkle;
|
||||
NifOgre::EntityList groin;
|
||||
NifOgre::EntityList lfoot;
|
||||
NifOgre::EntityList rfoot;
|
||||
NifOgre::EntityList hair;
|
||||
NifOgre::EntityList head;
|
||||
|
||||
bool isBeast;
|
||||
bool isFemale;
|
||||
|
@ -63,10 +63,10 @@ private:
|
|||
public:
|
||||
NpcAnimation(const MWWorld::Ptr& ptr, OEngine::Render::OgreRenderer& _rend, MWWorld::InventoryStore& _inv);
|
||||
virtual ~NpcAnimation();
|
||||
std::vector<Ogre::Entity*> insertBoundedPart(const std::string &mesh, const std::string &bonename);
|
||||
NifOgre::EntityList insertBoundedPart(const std::string &mesh, const std::string &bonename);
|
||||
virtual void runAnimation(float timepassed);
|
||||
void updateParts();
|
||||
void removeEntities(std::vector<Ogre::Entity*> &entities);
|
||||
void removeEntities(NifOgre::EntityList &entities);
|
||||
void removeIndividualPart(int type);
|
||||
void reserveIndividualPart(int type, int group, int priority);
|
||||
|
||||
|
|
Loading…
Reference in a new issue