1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 22:23:51 +00:00

Fix ventriloquism

This commit is contained in:
Alexei Dobrohotov 2019-08-10 19:21:36 +03:00 committed by GitHub
parent 75fc57d1d3
commit eaedf34975
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1118,16 +1118,6 @@ namespace NifOsg
ctrl = static_cast<const Nif::NiTriShape*>(nifNode)->controller; ctrl = static_cast<const Nif::NiTriShape*>(nifNode)->controller;
else else
ctrl = static_cast<const Nif::NiTriStrips*>(nifNode)->controller; ctrl = static_cast<const Nif::NiTriStrips*>(nifNode)->controller;
handleMorphController(ctrl, drawable, geom, parentNode, composite, boundTextures, animflags);
if (!drawable.get())
drawable = geom;
drawable->setName(nifNode->name);
parentNode->addChild(drawable);
}
void handleMorphController(Nif::ControllerPtr ctrl, osg::Drawable *drawable, osg::ref_ptr<osg::Geometry> geom, osg::Node* parentNode, SceneUtil::CompositeStateSetUpdater* composite, const std::vector<int>& boundTextures, int animflags)
{
for (; !ctrl.empty(); ctrl = ctrl->next) for (; !ctrl.empty(); ctrl = ctrl->next)
{ {
if (!(ctrl->flags & Nif::NiNode::ControllerFlag_Active)) if (!(ctrl->flags & Nif::NiNode::ControllerFlag_Active))
@ -1143,6 +1133,10 @@ namespace NifOsg
break; break;
} }
} }
if (!drawable.get())
drawable = geom;
drawable->setName(nifNode->name);
parentNode->addChild(drawable);
} }
osg::ref_ptr<osg::Drawable> handleMorphGeometry(const Nif::NiGeomMorpherController* morpher, osg::ref_ptr<osg::Geometry> sourceGeometry, osg::Node* parentNode, SceneUtil::CompositeStateSetUpdater* composite, const std::vector<int>& boundTextures, int animflags) osg::ref_ptr<osg::Drawable> handleMorphGeometry(const Nif::NiGeomMorpherController* morpher, osg::ref_ptr<osg::Geometry> sourceGeometry, osg::Node* parentNode, SceneUtil::CompositeStateSetUpdater* composite, const std::vector<int>& boundTextures, int animflags)