mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-23 19:10:21 +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:
parent
978b9e9285
commit
d3c24a6ea4
1 changed files with 9 additions and 5 deletions
|
@ -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…
Reference in a new issue