From 25a6a67508f777d326fcfab105f8509cbb62cda9 Mon Sep 17 00:00:00 2001 From: scrawl <720642+scrawl@users.noreply.github.com> Date: Mon, 29 Jan 2018 19:44:12 +0000 Subject: [PATCH] Fix the optimizer messing up LOD node's children (Fixes #4301) --- components/sceneutil/optimizer.cpp | 13 +++++++++++++ components/sceneutil/optimizer.hpp | 2 ++ 2 files changed, 15 insertions(+) diff --git a/components/sceneutil/optimizer.cpp b/components/sceneutil/optimizer.cpp index e7d5b3a40..b86744599 100644 --- a/components/sceneutil/optimizer.cpp +++ b/components/sceneutil/optimizer.cpp @@ -800,6 +800,13 @@ bool Optimizer::RemoveRedundantNodesVisitor::isOperationPermissible(osg::Node& n isOperationPermissibleForObject(&node); } +void Optimizer::RemoveRedundantNodesVisitor::apply(osg::LOD& lod) +{ + // don't remove any direct children of the LOD because they are used to define each LOD level. + for (unsigned int i=0; i