forked from mirror/openmw-tes3mp
Update part skeletons immediately when added
This commit is contained in:
parent
dc0360b1f6
commit
4641737fc4
1 changed files with 16 additions and 11 deletions
|
@ -493,20 +493,25 @@ bool NpcAnimation::addOrReplaceIndividualPart(ESM::PartReferenceType type, int g
|
||||||
mPartPriorities[type] = priority;
|
mPartPriorities[type] = priority;
|
||||||
|
|
||||||
mObjectParts[type] = insertBoundedPart(mesh, group, sPartList.at(type));
|
mObjectParts[type] = insertBoundedPart(mesh, group, sPartList.at(type));
|
||||||
if(mObjectParts[type].mSkelBase && mObjectParts[type].mSkelBase->isParentTagPoint())
|
if(mObjectParts[type].mSkelBase)
|
||||||
{
|
{
|
||||||
Ogre::Node *root = mObjectParts[type].mSkelBase->getParentNode();
|
|
||||||
Ogre::SkeletonInstance *skel = mObjectParts[type].mSkelBase->getSkeleton();
|
Ogre::SkeletonInstance *skel = mObjectParts[type].mSkelBase->getSkeleton();
|
||||||
if(skel->hasBone("BoneOffset"))
|
if(mObjectParts[type].mSkelBase->isParentTagPoint())
|
||||||
{
|
{
|
||||||
Ogre::Bone *offset = skel->getBone("BoneOffset");
|
Ogre::Node *root = mObjectParts[type].mSkelBase->getParentNode();
|
||||||
root->translate(offset->getPosition());
|
if(skel->hasBone("BoneOffset"))
|
||||||
root->rotate(offset->getOrientation());
|
{
|
||||||
// HACK: Why an extra -90 degree rotation?
|
Ogre::Bone *offset = skel->getBone("BoneOffset");
|
||||||
root->pitch(Ogre::Degree(-90.0f));
|
root->translate(offset->getPosition());
|
||||||
root->scale(offset->getScale());
|
root->rotate(offset->getOrientation());
|
||||||
root->setInitialState();
|
// HACK: Why an extra -90 degree rotation?
|
||||||
|
root->pitch(Ogre::Degree(-90.0f));
|
||||||
|
root->scale(offset->getScale());
|
||||||
|
root->setInitialState();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateSkeletonInstance(mSkelBase->getSkeleton(), skel);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO:
|
// TODO:
|
||||||
|
@ -521,7 +526,7 @@ bool NpcAnimation::addOrReplaceIndividualPart(ESM::PartReferenceType type, int g
|
||||||
ctrl->setSource(mNullAnimationValuePtr);
|
ctrl->setSource(mNullAnimationValuePtr);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NpcAnimation::addPartGroup(int group, int priority, const std::vector<ESM::PartReference> &parts)
|
void NpcAnimation::addPartGroup(int group, int priority, const std::vector<ESM::PartReference> &parts)
|
||||||
|
|
Loading…
Reference in a new issue