Disable head controller for non-bipedal creatures (Fixes #2843, Fixes #2966)

openmw-37
scrawl 9 years ago
parent a88d56148b
commit ee450471fd

@ -1320,13 +1320,16 @@ namespace MWRender
{
mHeadController = NULL;
NodeMap::iterator found = mNodeMap.find("bip01 head");
if (found != mNodeMap.end() && dynamic_cast<osg::MatrixTransform*>(found->second.get()))
if (mPtr.getClass().isBipedal(mPtr))
{
osg::Node* node = found->second;
mHeadController = new RotateController(mObjectRoot.get());
node->addUpdateCallback(mHeadController);
mActiveControllers.insert(std::make_pair(node, mHeadController));
NodeMap::iterator found = mNodeMap.find("bip01 head");
if (found != mNodeMap.end() && dynamic_cast<osg::MatrixTransform*>(found->second.get()))
{
osg::Node* node = found->second;
mHeadController = new RotateController(mObjectRoot.get());
node->addUpdateCallback(mHeadController);
mActiveControllers.insert(std::make_pair(node, mHeadController));
}
}
}

Loading…
Cancel
Save