forked from mirror/openmw-tes3mp
Attach skinned parts to the scene node instead of the named bone
This commit is contained in:
parent
5154188110
commit
d9b64b77ec
3 changed files with 6 additions and 5 deletions
|
@ -342,7 +342,7 @@ void NpcAnimation::updateParts()
|
||||||
NifOgre::EntityList 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(mEntityList.mSkelBase, bonename,
|
NifOgre::EntityList entities = NIFLoader::createEntities(mEntityList.mSkelBase, bonename,
|
||||||
mInsert->getCreator(), mesh);
|
mInsert, mesh);
|
||||||
std::vector<Ogre::Entity*> &parts = entities.mEntities;
|
std::vector<Ogre::Entity*> &parts = entities.mEntities;
|
||||||
for(size_t i = 0;i < parts.size();i++)
|
for(size_t i = 0;i < parts.size();i++)
|
||||||
parts[i]->setVisibilityFlags(RV_Actors);
|
parts[i]->setVisibilityFlags(RV_Actors);
|
||||||
|
|
|
@ -925,7 +925,7 @@ EntityList NIFLoader::createEntities(Ogre::SceneNode *parent, const std::string
|
||||||
}
|
}
|
||||||
|
|
||||||
EntityList NIFLoader::createEntities(Ogre::Entity *parent, const std::string &bonename,
|
EntityList NIFLoader::createEntities(Ogre::Entity *parent, const std::string &bonename,
|
||||||
Ogre::SceneManager *sceneMgr,
|
Ogre::SceneNode *parentNode,
|
||||||
const std::string &name,
|
const std::string &name,
|
||||||
const std::string &group)
|
const std::string &group)
|
||||||
{
|
{
|
||||||
|
@ -935,6 +935,7 @@ EntityList NIFLoader::createEntities(Ogre::Entity *parent, const std::string &bo
|
||||||
if(meshes.size() == 0)
|
if(meshes.size() == 0)
|
||||||
return entitylist;
|
return entitylist;
|
||||||
|
|
||||||
|
Ogre::SceneManager *sceneMgr = parentNode->getCreator();
|
||||||
std::string filter = "Tri "+bonename;
|
std::string filter = "Tri "+bonename;
|
||||||
for(size_t i = 0;i < meshes.size();i++)
|
for(size_t i = 0;i < meshes.size();i++)
|
||||||
{
|
{
|
||||||
|
@ -957,14 +958,14 @@ EntityList NIFLoader::createEntities(Ogre::Entity *parent, const std::string &bo
|
||||||
if(entitylist.mSkelBase)
|
if(entitylist.mSkelBase)
|
||||||
{
|
{
|
||||||
entitylist.mSkelBase->shareSkeletonInstanceWith(parent);
|
entitylist.mSkelBase->shareSkeletonInstanceWith(parent);
|
||||||
parent->attachObjectToBone(bonename, entitylist.mSkelBase);
|
parentNode->attachObject(entitylist.mSkelBase);
|
||||||
for(size_t i = 0;i < entitylist.mEntities.size();i++)
|
for(size_t i = 0;i < entitylist.mEntities.size();i++)
|
||||||
{
|
{
|
||||||
Ogre::Entity *entity = entitylist.mEntities[i];
|
Ogre::Entity *entity = entitylist.mEntities[i];
|
||||||
if(entity != entitylist.mSkelBase && entity->hasSkeleton())
|
if(entity != entitylist.mSkelBase && entity->hasSkeleton())
|
||||||
{
|
{
|
||||||
entity->shareSkeletonInstanceWith(parent);
|
entity->shareSkeletonInstanceWith(parent);
|
||||||
parent->attachObjectToBone(bonename, entity);
|
parentNode->attachObject(entity);
|
||||||
}
|
}
|
||||||
else if(entity != entitylist.mSkelBase)
|
else if(entity != entitylist.mSkelBase)
|
||||||
parent->attachObjectToBone(bonename, entity);
|
parent->attachObjectToBone(bonename, entity);
|
||||||
|
|
|
@ -91,7 +91,7 @@ class NIFLoader
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static EntityList createEntities(Ogre::Entity *parent, const std::string &bonename,
|
static EntityList createEntities(Ogre::Entity *parent, const std::string &bonename,
|
||||||
Ogre::SceneManager *sceneMgr,
|
Ogre::SceneNode *parentNode,
|
||||||
const std::string &name,
|
const std::string &name,
|
||||||
const std::string &group="General");
|
const std::string &group="General");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue