From 8f6d4fb3e0ce53786a8aad5eb75a94d831f45f15 Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 16 Apr 2015 01:26:58 +0200 Subject: [PATCH] Fix filtering bug --- components/sceneutil/attach.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/components/sceneutil/attach.cpp b/components/sceneutil/attach.cpp index 882bd66ec..f084704c3 100644 --- a/components/sceneutil/attach.cpp +++ b/components/sceneutil/attach.cpp @@ -12,6 +12,8 @@ #include #include +#include + #include "visitor.hpp" namespace SceneUtil @@ -110,13 +112,14 @@ namespace SceneUtil public: FilterVisitor(const std::string& filter) : osg::NodeVisitor(TRAVERSE_ALL_CHILDREN) - , mFilter(filter) + , mFilter(Misc::StringUtils::lowerCase(filter)) { } virtual void apply(osg::Geode &node) { - if (node.getName().find(mFilter) == std::string::npos) + std::string lowerName = Misc::StringUtils::lowerCase(node.getName()); + if (lowerName.find(mFilter) == std::string::npos) { mToRemove.push_back(&node); } @@ -133,7 +136,7 @@ namespace SceneUtil private: std::vector mToRemove; - const std::string& mFilter; + std::string mFilter; }; osg::ref_ptr attach(osg::ref_ptr toAttach, osg::Node *master, const std::string &filter, const std::string &attachNode)