From eae35af13d17d84efe4ed6c7e7812dadd71d1330 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 17 Dec 2016 00:23:22 +0100 Subject: [PATCH] Check if the bounding box changed before calling dirtyBound() --- components/sceneutil/riggeometry.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/components/sceneutil/riggeometry.cpp b/components/sceneutil/riggeometry.cpp index 297dc6923..92780bfe9 100644 --- a/components/sceneutil/riggeometry.cpp +++ b/components/sceneutil/riggeometry.cpp @@ -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; idirtyBound(); + if (box != _boundingBox) + { + _boundingBox = box; + _boundingSphere = osg::BoundingSphere(_boundingBox); + _boundingSphereComputed = true; + for (unsigned int i=0; idirtyBound(); + } } void RigGeometry::updateGeomToSkelMatrix(const osg::NodePath& nodePath)