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); box.expandBy(bs);
} }
_boundingBox = box; if (box != _boundingBox)
_boundingSphere = osg::BoundingSphere(_boundingBox); {
_boundingSphereComputed = true; _boundingBox = box;
for (unsigned int i=0; i<getNumParents(); ++i) _boundingSphere = osg::BoundingSphere(_boundingBox);
getParent(i)->dirtyBound(); _boundingSphereComputed = true;
for (unsigned int i=0; i<getNumParents(); ++i)
getParent(i)->dirtyBound();
}
} }
void RigGeometry::updateGeomToSkelMatrix(const osg::NodePath& nodePath) void RigGeometry::updateGeomToSkelMatrix(const osg::NodePath& nodePath)