mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-26 14:36:40 -04: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:
parent
978b9e9285
commit
d3c24a6ea4
@ -1481,10 +1481,12 @@ namespace MWRender
|
|||||||
void Animation::setObjectRoot(const std::string &model, bool forceskeleton, bool baseonly, bool isCreature)
|
void Animation::setObjectRoot(const std::string &model, bool forceskeleton, bool baseonly, bool isCreature)
|
||||||
{
|
{
|
||||||
osg::ref_ptr<osg::StateSet> previousStateset;
|
osg::ref_ptr<osg::StateSet> previousStateset;
|
||||||
osg::ref_ptr<osg::Callback> previousCullCallback;
|
|
||||||
if (mObjectRoot)
|
if (mObjectRoot)
|
||||||
{
|
{
|
||||||
previousCullCallback = mObjectRoot->getCullCallback();
|
if (mLightListCallback)
|
||||||
|
mObjectRoot->removeCullCallback(mLightListCallback);
|
||||||
|
if (mTransparencyUpdater)
|
||||||
|
mObjectRoot->removeCullCallback(mTransparencyUpdater);
|
||||||
previousStateset = mObjectRoot->getStateSet();
|
previousStateset = mObjectRoot->getStateSet();
|
||||||
mObjectRoot->getParent(0)->removeChild(mObjectRoot);
|
mObjectRoot->getParent(0)->removeChild(mObjectRoot);
|
||||||
}
|
}
|
||||||
@ -1573,9 +1575,11 @@ namespace MWRender
|
|||||||
removeTriBipVisitor.remove();
|
removeTriBipVisitor.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!previousCullCallback)
|
if (!mLightListCallback)
|
||||||
previousCullCallback = mLightListCallback;
|
mLightListCallback = new SceneUtil::LightListCallback;
|
||||||
mObjectRoot->setCullCallback(previousCullCallback);
|
mObjectRoot->addCullCallback(mLightListCallback);
|
||||||
|
if (mTransparencyUpdater)
|
||||||
|
mObjectRoot->addCullCallback(mTransparencyUpdater);
|
||||||
}
|
}
|
||||||
|
|
||||||
osg::Group* Animation::getObjectRoot()
|
osg::Group* Animation::getObjectRoot()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user