diff --git a/components/sceneutil/lightmanager.cpp b/components/sceneutil/lightmanager.cpp index f9182c1d2d..64448e73e9 100644 --- a/components/sceneutil/lightmanager.cpp +++ b/components/sceneutil/lightmanager.cpp @@ -309,8 +309,15 @@ namespace SceneUtil const osg::RefMatrix* viewMatrix = cv->getCurrentRenderStage()->getInitialViewMatrix(); const std::vector& lights = mLightManager->getLightsInViewSpace(cv->getCurrentCamera(), viewMatrix); - // we do the intersections in view space - osg::BoundingSphere nodeBound = node->getBound(); + // 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) + { + for (unsigned int i=0; igetNumChildren(); ++i) + nodeBound.expandBy(group->getChild(i)->getBound()); + } osg::Matrixf mat = *cv->getModelViewMatrix(); transformBoundingSphere(mat, nodeBound);