From 336612359b80198ff50b367ea9fe93ccbcb59fab Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sat, 12 Feb 2005 16:24:28 +0000 Subject: [PATCH] From Tugkan Calapoglu, bug fix to FLATTEN_STATIC_TRANSFORMS. Small tweak of the code to make the comparison against Identity matrix clearer. --- src/osgUtil/Optimizer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/osgUtil/Optimizer.cpp b/src/osgUtil/Optimizer.cpp index 0fff67fcb..3f0911e59 100644 --- a/src/osgUtil/Optimizer.cpp +++ b/src/osgUtil/Optimizer.cpp @@ -631,9 +631,8 @@ class CollectLowestTransformsVisitor : public osg::NodeVisitor if (_transformSet.empty()) transform->computeLocalToWorldMatrix(_firstMatrix,0); else { - osg::Matrix matrix; transform->computeLocalToWorldMatrix(_firstMatrix,0); - if (_firstMatrix!=matrix) _moreThanOneMatrixRequired=true; + if (_firstMatrix!=_identity_matrix) _moreThanOneMatrixRequired=true; } } } @@ -641,7 +640,7 @@ class CollectLowestTransformsVisitor : public osg::NodeVisitor { if (!_transformSet.empty()) { - if (_firstMatrix!=osg::Matrix::identity()) _moreThanOneMatrixRequired=true; + if (_firstMatrix!=_identity_matrix) _moreThanOneMatrixRequired=true; } } @@ -652,6 +651,7 @@ class CollectLowestTransformsVisitor : public osg::NodeVisitor bool _moreThanOneMatrixRequired; osg::Matrix _firstMatrix; TransformSet _transformSet; + osg::Matrix _identity_matrix; };