Don't add RotateController to an uncontrolled node

move
scrawl 9 years ago
parent 8791063110
commit 87871d7d54

@ -1353,9 +1353,24 @@ namespace MWRender
if (found != getNodeMap().end()) if (found != getNodeMap().end())
{ {
osg::MatrixTransform* node = found->second; osg::MatrixTransform* node = found->second;
mHeadController = new RotateController(mObjectRoot.get());
node->addUpdateCallback(mHeadController); bool foundKeyframeCtrl = false;
mActiveControllers.insert(std::make_pair(node, mHeadController)); osg::Callback* cb = node->getUpdateCallback();
while (cb)
{
if (dynamic_cast<NifOsg::KeyframeController*>(cb))
{
foundKeyframeCtrl = true;
break;
}
}
if (foundKeyframeCtrl)
{
mHeadController = new RotateController(mObjectRoot.get());
node->addUpdateCallback(mHeadController);
mActiveControllers.insert(std::make_pair(node, mHeadController));
}
} }
} }
} }

Loading…
Cancel
Save