mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-28 19:21:04 +00:00
Merge pull request #2865 from Capostrophic/headtracking
Re-enable non-biped creature headtracking (bug #5424)
This commit is contained in:
commit
2618974ad6
@ -16,6 +16,7 @@
|
|||||||
Bug #5400: Editor: Verifier checks race of non-skin bodyparts
|
Bug #5400: Editor: Verifier checks race of non-skin bodyparts
|
||||||
Bug #5415: Environment maps in ebony cuirass and HiRez Armors Indoril cuirass don't work
|
Bug #5415: Environment maps in ebony cuirass and HiRez Armors Indoril cuirass don't work
|
||||||
Bug #5416: Junk non-node records before the root node are not handled gracefully
|
Bug #5416: Junk non-node records before the root node are not handled gracefully
|
||||||
|
Bug #5424: Creatures do not headtrack player
|
||||||
Feature #5362: Show the soul gems' trapped soul in count dialog
|
Feature #5362: Show the soul gems' trapped soul in count dialog
|
||||||
|
|
||||||
0.46.0
|
0.46.0
|
||||||
|
@ -1815,33 +1815,30 @@ namespace MWRender
|
|||||||
{
|
{
|
||||||
mHeadController = nullptr;
|
mHeadController = nullptr;
|
||||||
|
|
||||||
if (mPtr.getClass().isBipedal(mPtr))
|
NodeMap::const_iterator found = getNodeMap().find("bip01 head");
|
||||||
|
if (found == getNodeMap().end())
|
||||||
|
return;
|
||||||
|
|
||||||
|
osg::MatrixTransform* node = found->second;
|
||||||
|
|
||||||
|
bool foundKeyframeCtrl = false;
|
||||||
|
osg::Callback* cb = node->getUpdateCallback();
|
||||||
|
while (cb)
|
||||||
{
|
{
|
||||||
NodeMap::const_iterator found = getNodeMap().find("bip01 head");
|
if (dynamic_cast<NifOsg::KeyframeController*>(cb))
|
||||||
if (found != getNodeMap().end())
|
|
||||||
{
|
{
|
||||||
osg::MatrixTransform* node = found->second;
|
foundKeyframeCtrl = true;
|
||||||
|
break;
|
||||||
bool foundKeyframeCtrl = false;
|
|
||||||
osg::Callback* cb = node->getUpdateCallback();
|
|
||||||
while (cb)
|
|
||||||
{
|
|
||||||
if (dynamic_cast<NifOsg::KeyframeController*>(cb))
|
|
||||||
{
|
|
||||||
foundKeyframeCtrl = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
cb = cb->getNestedCallback();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (foundKeyframeCtrl)
|
|
||||||
{
|
|
||||||
mHeadController = new RotateController(mObjectRoot.get());
|
|
||||||
node->addUpdateCallback(mHeadController);
|
|
||||||
mActiveControllers.emplace_back(node, mHeadController);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
cb = cb->getNestedCallback();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!foundKeyframeCtrl)
|
||||||
|
return;
|
||||||
|
|
||||||
|
mHeadController = new RotateController(mObjectRoot.get());
|
||||||
|
node->addUpdateCallback(mHeadController);
|
||||||
|
mActiveControllers.emplace_back(node, mHeadController);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Animation::setHeadPitch(float pitchRadians)
|
void Animation::setHeadPitch(float pitchRadians)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user