From c95868969be307d713fd36c150cb91cb0010c6a9 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 4 Feb 2017 01:22:43 +0100 Subject: [PATCH] Early out for scene graphs with no update callbacks in SceneManager::notifyAttached --- components/resource/scenemanager.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/components/resource/scenemanager.cpp b/components/resource/scenemanager.cpp index de4ce28a55..c975286ce9 100644 --- a/components/resource/scenemanager.cpp +++ b/components/resource/scenemanager.cpp @@ -478,8 +478,12 @@ namespace Resource void SceneManager::notifyAttached(osg::Node *node) const { - InitWorldSpaceParticlesVisitor visitor (mParticleSystemMask); - node->accept(visitor); + // we can skip any scene graphs without update callbacks since we know that particle emitters will have an update callback set + if (node->getNumChildrenRequiringUpdateTraversal() > 0) + { + InitWorldSpaceParticlesVisitor visitor (mParticleSystemMask); + node->accept(visitor); + } } Resource::ImageManager* SceneManager::getImageManager()