1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-07 03:54:40 +00:00

Add case sensitivity workaround for spine bones (Fixes #1547)

This commit is contained in:
scrawl 2014-06-21 19:54:12 +02:00
parent a4ce9d6a7f
commit 98329a94b4

View File

@ -150,9 +150,19 @@ void WeaponAnimation::pitchSkeleton(float xrot, Ogre::SkeletonInstance* skel)
return;
float pitch = xrot * mPitchFactor;
Ogre::Node *node = skel->getBone("Bip01 Spine2");
Ogre::Node *node;
// In spherearcher.nif, we have spine, not Spine. Not sure if all bone names should be case insensitive?
if (skel->hasBone("Bip01 spine2"))
node = skel->getBone("Bip01 spine2");
else
node = skel->getBone("Bip01 Spine2");
node->pitch(Ogre::Radian(-pitch/2), Ogre::Node::TS_WORLD);
node = skel->getBone("Bip01 Spine1");
if (skel->hasBone("Bip01 spine1")) // in spherearcher.nif
node = skel->getBone("Bip01 spine1");
else
node = skel->getBone("Bip01 Spine1");
node->pitch(Ogre::Radian(-pitch/2), Ogre::Node::TS_WORLD);
}