|
|
|
@ -1815,33 +1815,30 @@ namespace MWRender
|
|
|
|
|
{
|
|
|
|
|
mHeadController = nullptr;
|
|
|
|
|
|
|
|
|
|
if (mPtr.getClass().isBipedal(mPtr))
|
|
|
|
|
{
|
|
|
|
|
NodeMap::const_iterator found = getNodeMap().find("bip01 head");
|
|
|
|
|
if (found != getNodeMap().end())
|
|
|
|
|
{
|
|
|
|
|
osg::MatrixTransform* node = found->second;
|
|
|
|
|
NodeMap::const_iterator found = getNodeMap().find("bip01 head");
|
|
|
|
|
if (found == getNodeMap().end())
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
bool foundKeyframeCtrl = false;
|
|
|
|
|
osg::Callback* cb = node->getUpdateCallback();
|
|
|
|
|
while (cb)
|
|
|
|
|
{
|
|
|
|
|
if (dynamic_cast<NifOsg::KeyframeController*>(cb))
|
|
|
|
|
{
|
|
|
|
|
foundKeyframeCtrl = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
cb = cb->getNestedCallback();
|
|
|
|
|
}
|
|
|
|
|
osg::MatrixTransform* node = found->second;
|
|
|
|
|
|
|
|
|
|
if (foundKeyframeCtrl)
|
|
|
|
|
{
|
|
|
|
|
mHeadController = new RotateController(mObjectRoot.get());
|
|
|
|
|
node->addUpdateCallback(mHeadController);
|
|
|
|
|
mActiveControllers.emplace_back(node, mHeadController);
|
|
|
|
|
}
|
|
|
|
|
bool foundKeyframeCtrl = false;
|
|
|
|
|
osg::Callback* cb = node->getUpdateCallback();
|
|
|
|
|
while (cb)
|
|
|
|
|
{
|
|
|
|
|
if (dynamic_cast<NifOsg::KeyframeController*>(cb))
|
|
|
|
|
{
|
|
|
|
|
foundKeyframeCtrl = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
cb = cb->getNestedCallback();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!foundKeyframeCtrl)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
mHeadController = new RotateController(mObjectRoot.get());
|
|
|
|
|
node->addUpdateCallback(mHeadController);
|
|
|
|
|
mActiveControllers.emplace_back(node, mHeadController);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Animation::setHeadPitch(float pitchRadians)
|
|
|
|
|