From 34130fc5ccfb36c9f65d705b0dd0a2587385204d Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 3 Mar 2017 18:20:47 +0100 Subject: [PATCH] Fix handling in LightListCallback when the node is not a Group --- components/sceneutil/lightmanager.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/components/sceneutil/lightmanager.cpp b/components/sceneutil/lightmanager.cpp index b421f87cf..341bc8034 100644 --- a/components/sceneutil/lightmanager.cpp +++ b/components/sceneutil/lightmanager.cpp @@ -417,12 +417,14 @@ namespace SceneUtil // get the node bounds in view space // NB do not node->getBound() * modelView, that would apply the node's transformation twice osg::BoundingSphere nodeBound; - osg::Group* group = node->asGroup(); - if (group) + osg::Transform* transform = node->asTransform(); + if (transform) { - for (unsigned int i=0; igetNumChildren(); ++i) - nodeBound.expandBy(group->getChild(i)->getBound()); + for (unsigned int i=0; igetNumChildren(); ++i) + nodeBound.expandBy(transform->getChild(i)->getBound()); } + else + nodeBound = node->getBound(); osg::Matrixf mat = *cv->getModelViewMatrix(); transformBoundingSphere(mat, nodeBound);