From 634ef7e3a62b45829031523c02c3ae512a9468c4 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sat, 9 Feb 2002 22:29:40 +0000 Subject: [PATCH] Fixed the osgUtil::Optimizer::FlattenStaticTransformVisitor so that it does not flatten drawables which have double references to them, but only one reference with a static transform on it. This case can't be flattened but this wasn't picked up. The code now detects the case correctly. --- src/osgUtil/Optimizer.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/osgUtil/Optimizer.cpp b/src/osgUtil/Optimizer.cpp index 9fd3f432c..5422fd113 100644 --- a/src/osgUtil/Optimizer.cpp +++ b/src/osgUtil/Optimizer.cpp @@ -17,7 +17,7 @@ using namespace osgUtil; void Optimizer::optimize(osg::Node* node, unsigned int options) { - + if (options & COMBINE_ADJACENT_LODS) { CombineLODsVisitor clv; @@ -289,14 +289,16 @@ void Optimizer::StateVisitor::optimize() void Optimizer::FlattenStaticTransformsVisitor::apply(osg::Geode& geode) { - if (!_matrixStack.empty()) + + osg::Matrix matrix; + if (!_matrixStack.empty()) matrix = _matrixStack.back(); + + for(int i=0;i