Check if the bounding box changed before calling dirtyBound()

This commit is contained in:
scrawl 2016-12-17 00:23:22 +01:00
parent 2b2a51d3b2
commit eae35af13d

View file

@ -320,11 +320,14 @@ void RigGeometry::updateBounds(osg::NodeVisitor *nv)
box.expandBy(bs);
}
_boundingBox = box;
_boundingSphere = osg::BoundingSphere(_boundingBox);
_boundingSphereComputed = true;
for (unsigned int i=0; i<getNumParents(); ++i)
getParent(i)->dirtyBound();
if (box != _boundingBox)
{
_boundingBox = box;
_boundingSphere = osg::BoundingSphere(_boundingBox);
_boundingSphereComputed = true;
for (unsigned int i=0; i<getNumParents(); ++i)
getParent(i)->dirtyBound();
}
}
void RigGeometry::updateGeomToSkelMatrix(const osg::NodePath& nodePath)