mirror of
https://github.com/OpenMW/openmw.git
synced 2025-05-31 19:41:32 +00:00
Don't updateBoneTree for non-skinned parts (Fixes #2124)
This commit is contained in:
parent
b650338d69
commit
75b0da5dce
1 changed files with 22 additions and 5 deletions
|
@ -60,6 +60,21 @@ std::string getVampireHead(const std::string& race, bool female)
|
||||||
return "meshes\\" + sVampireMapping[thisCombination]->mModel;
|
return "meshes\\" + sVampireMapping[thisCombination]->mModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isSkinned (NifOgre::ObjectScenePtr scene)
|
||||||
|
{
|
||||||
|
if (scene->mSkelBase == NULL)
|
||||||
|
return false;
|
||||||
|
for(size_t j = 0; j < scene->mEntities.size(); j++)
|
||||||
|
{
|
||||||
|
Ogre::Entity *ent = scene->mEntities[j];
|
||||||
|
if(scene->mSkelBase != ent && ent->hasSkeleton())
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -611,10 +626,11 @@ Ogre::Vector3 NpcAnimation::runAnimation(float timepassed)
|
||||||
for(;ctrl != mObjectParts[i]->mControllers.end();++ctrl)
|
for(;ctrl != mObjectParts[i]->mControllers.end();++ctrl)
|
||||||
ctrl->update();
|
ctrl->update();
|
||||||
|
|
||||||
Ogre::Entity *ent = mObjectParts[i]->mSkelBase;
|
if (!isSkinned(mObjectParts[i]))
|
||||||
if(!ent) continue;
|
continue;
|
||||||
updateSkeletonInstance(baseinst, ent->getSkeleton());
|
|
||||||
ent->getAllAnimationStates()->_notifyDirty();
|
updateSkeletonInstance(baseinst, mObjectParts[i]->mSkelBase->getSkeleton());
|
||||||
|
mObjectParts[i]->mSkelBase->getAllAnimationStates()->_notifyDirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -697,7 +713,8 @@ bool NpcAnimation::addOrReplaceIndividualPart(ESM::PartReferenceType type, int g
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
updateSkeletonInstance(mSkelBase->getSkeleton(), skel);
|
if (isSkinned(mObjectParts[type]))
|
||||||
|
updateSkeletonInstance(mSkelBase->getSkeleton(), skel);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<Ogre::Controller<Ogre::Real> >::iterator ctrl(mObjectParts[type]->mControllers.begin());
|
std::vector<Ogre::Controller<Ogre::Real> >::iterator ctrl(mObjectParts[type]->mControllers.begin());
|
||||||
|
|
Loading…
Reference in a new issue