1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-01 07:15:32 +00:00

Should resolve the original cause of #5509 and prevent mesh from growing while switching back and for from 3rd and 1st person view

This commit is contained in:
Bret Curtis 2020-07-02 22:01:42 +02:00
parent 978b9e9285
commit d3c24a6ea4

View file

@ -1481,10 +1481,12 @@ namespace MWRender
void Animation::setObjectRoot(const std::string &model, bool forceskeleton, bool baseonly, bool isCreature)
{
osg::ref_ptr<osg::StateSet> previousStateset;
osg::ref_ptr<osg::Callback> previousCullCallback;
if (mObjectRoot)
{
previousCullCallback = mObjectRoot->getCullCallback();
if (mLightListCallback)
mObjectRoot->removeCullCallback(mLightListCallback);
if (mTransparencyUpdater)
mObjectRoot->removeCullCallback(mTransparencyUpdater);
previousStateset = mObjectRoot->getStateSet();
mObjectRoot->getParent(0)->removeChild(mObjectRoot);
}
@ -1573,9 +1575,11 @@ namespace MWRender
removeTriBipVisitor.remove();
}
if (!previousCullCallback)
previousCullCallback = mLightListCallback;
mObjectRoot->setCullCallback(previousCullCallback);
if (!mLightListCallback)
mLightListCallback = new SceneUtil::LightListCallback;
mObjectRoot->addCullCallback(mLightListCallback);
if (mTransparencyUpdater)
mObjectRoot->addCullCallback(mTransparencyUpdater);
}
osg::Group* Animation::getObjectRoot()