diff --git a/components/sceneutil/optimizer.cpp b/components/sceneutil/optimizer.cpp index 99f7ae122..460cd2c5e 100644 --- a/components/sceneutil/optimizer.cpp +++ b/components/sceneutil/optimizer.cpp @@ -281,11 +281,11 @@ class CollectLowestTransformsVisitor : public BaseOptimizerVisitor ObjectStruct():_canBeApplied(true),_moreThanOneMatrixRequired(false) {} - void add(osg::Transform* transform) + void add(osg::Transform* transform, bool canOptimize) { if (transform) { - if (transform->getDataVariance()!=osg::Transform::STATIC) _moreThanOneMatrixRequired=true; + if (!canOptimize) _moreThanOneMatrixRequired=true; else if (transform->getReferenceFrame()!=osg::Transform::RELATIVE_RF) _moreThanOneMatrixRequired=true; else { @@ -322,7 +322,7 @@ class CollectLowestTransformsVisitor : public BaseOptimizerVisitor itr!=_currentObjectList.end(); ++itr) { - _objectMap[*itr].add(transform); + _objectMap[*itr].add(transform, transform && isOperationPermissibleForObject(transform)); } }