mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-05 19:20:13 +00:00
Don't add RotateController to an uncontrolled node
This commit is contained in:
parent
8791063110
commit
87871d7d54
1 changed files with 18 additions and 3 deletions
|
@ -1353,12 +1353,27 @@ namespace MWRender
|
||||||
if (found != getNodeMap().end())
|
if (found != getNodeMap().end())
|
||||||
{
|
{
|
||||||
osg::MatrixTransform* node = found->second;
|
osg::MatrixTransform* node = found->second;
|
||||||
|
|
||||||
|
bool foundKeyframeCtrl = false;
|
||||||
|
osg::Callback* cb = node->getUpdateCallback();
|
||||||
|
while (cb)
|
||||||
|
{
|
||||||
|
if (dynamic_cast<NifOsg::KeyframeController*>(cb))
|
||||||
|
{
|
||||||
|
foundKeyframeCtrl = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (foundKeyframeCtrl)
|
||||||
|
{
|
||||||
mHeadController = new RotateController(mObjectRoot.get());
|
mHeadController = new RotateController(mObjectRoot.get());
|
||||||
node->addUpdateCallback(mHeadController);
|
node->addUpdateCallback(mHeadController);
|
||||||
mActiveControllers.insert(std::make_pair(node, mHeadController));
|
mActiveControllers.insert(std::make_pair(node, mHeadController));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Animation::setHeadPitch(float pitchRadians)
|
void Animation::setHeadPitch(float pitchRadians)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue