From 3df7a8c4d8cb014a3aa693ded677bcacfd6ff433 Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 23 Feb 2017 22:05:32 +0100 Subject: [PATCH] Avoid FLATTEN_STATIC_TRANSFORMS optimization for non-Geometry drawables --- components/resource/scenemanager.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/components/resource/scenemanager.cpp b/components/resource/scenemanager.cpp index f35ff69c1..8d717f7ea 100644 --- a/components/resource/scenemanager.cpp +++ b/components/resource/scenemanager.cpp @@ -392,6 +392,18 @@ namespace Resource return reservedNames.find(name) != reservedNames.end(); } + virtual bool isOperationPermissibleForObjectImplementation(const SceneUtil::Optimizer* optimizer, const osg::Drawable* node,unsigned int option) const + { + if (option & SceneUtil::Optimizer::FLATTEN_STATIC_TRANSFORMS) + { + if (node->asGeometry() && node->className() == std::string("Geometry")) + return true; + else + return false; //ParticleSystem would have to convert space of all the processors, RigGeometry would have to convert bones... theoretically possible, but very complicated + } + return (option & optimizer->getPermissibleOptimizationsForObject(node))!=0; + } + virtual bool isOperationPermissibleForObjectImplementation(const SceneUtil::Optimizer* optimizer, const osg::Node* node,unsigned int option) const { if (node->getNumDescriptions()>0) return false;