From 47622e6134a3c00ec4c4b9c645bb808573d96835 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 8 Feb 2007 15:47:05 +0000 Subject: [PATCH] Fixed the FlattenStaticTransform visitor so that it excludes subgraphs that contain PagedLOD nodes --- include/osgUtil/Optimizer | 1 + src/osgUtil/Optimizer.cpp | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/include/osgUtil/Optimizer b/include/osgUtil/Optimizer index cab8a0578..709401360 100644 --- a/include/osgUtil/Optimizer +++ b/include/osgUtil/Optimizer @@ -262,6 +262,7 @@ class OSGUTIL_EXPORT Optimizer virtual void apply(osg::Geode& geode); virtual void apply(osg::Billboard& geode); virtual void apply(osg::ProxyNode& node); + virtual void apply(osg::PagedLOD& node); virtual void apply(osg::Transform& transform); bool removeTransforms(osg::Node* nodeWeCannotRemove); diff --git a/src/osgUtil/Optimizer.cpp b/src/osgUtil/Optimizer.cpp index 76e3d2c92..b1a9952c5 100644 --- a/src/osgUtil/Optimizer.cpp +++ b/src/osgUtil/Optimizer.cpp @@ -758,6 +758,7 @@ class CollectLowestTransformsVisitor : public BaseOptimizerVisitor // disable if object is a light point node. if (strcmp(node->className(),"LightPointNode")==0) return false; if (dynamic_cast(node)) return false; + if (dynamic_cast(node)) return false; return BaseOptimizerVisitor::isOperationPermissibleForObject(node); } @@ -1096,6 +1097,13 @@ void Optimizer::FlattenStaticTransformsVisitor::apply(osg::ProxyNode& node) traverse(node); } +void Optimizer::FlattenStaticTransformsVisitor::apply(osg::PagedLOD& node) +{ + _excludedNodeSet.insert(&node); + + traverse(node); +} + void Optimizer::FlattenStaticTransformsVisitor::apply(osg::Geode& geode) { @@ -1173,6 +1181,7 @@ bool Optimizer::FlattenStaticTransformsVisitor::removeTransforms(osg::Node* node titr!=_transformSet.end(); ++titr) { + osg::notify(osg::NOTICE)<<"Disabling transform"<