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; mHeadController = NULL;
NodeMap::iterator found = mNodeMap.find("bip01 head"); if (mPtr.getClass().isBipedal(mPtr))
if (found != mNodeMap.end() && dynamic_cast<osg::MatrixTransform*>(found->second.get()))
{ {
osg::Node* node = found->second; NodeMap::iterator found = mNodeMap.find("bip01 head");
mHeadController = new RotateController(mObjectRoot.get()); if (found != mNodeMap.end() && dynamic_cast<osg::MatrixTransform*>(found->second.get()))
node->addUpdateCallback(mHeadController); {
mActiveControllers.insert(std::make_pair(node, mHeadController)); osg::Node* node = found->second;
mHeadController = new RotateController(mObjectRoot.get());
node->addUpdateCallback(mHeadController);
mActiveControllers.insert(std::make_pair(node, mHeadController));
}
} }
} }

Loading…
Cancel
Save