From ec658b115c3f8b6964a8da72f53326d8f1abfb07 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 24 Apr 2014 10:38:58 +0000 Subject: [PATCH] Fixed reference invalidation bug. --- src/osgSim/SphereSegment.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/osgSim/SphereSegment.cpp b/src/osgSim/SphereSegment.cpp index fdb4f87d1..3b25fce1b 100644 --- a/src/osgSim/SphereSegment.cpp +++ b/src/osgSim/SphereSegment.cpp @@ -1030,14 +1030,12 @@ class PolytopeVisitor : public osg::NodeVisitor { if (_polytopeStack.back().second.contains(transform.getBound())) { - const osg::Polytope& polytope = _polytopeStack.front().second; - osg::Matrix matrix = _polytopeStack.back().first; transform.computeLocalToWorldMatrix(matrix, this); _polytopeStack.push_back(MatrixPolytopePair()); _polytopeStack.back().first = matrix; - _polytopeStack.back().second.setAndTransformProvidingInverse(polytope, matrix); + _polytopeStack.back().second.setAndTransformProvidingInverse(_polytopeStack.front().second, matrix); traverse(transform);