From e1c7165bfb37c881aeb753dd67479501620d14fb Mon Sep 17 00:00:00 2001 From: scrawl Date: Wed, 6 Jan 2016 23:16:47 +0100 Subject: [PATCH] Fix bounds calculation for addLight to a transform node --- components/sceneutil/lightutil.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/sceneutil/lightutil.cpp b/components/sceneutil/lightutil.cpp index 00f7f4d13..725157e23 100644 --- a/components/sceneutil/lightutil.cpp +++ b/components/sceneutil/lightutil.cpp @@ -55,7 +55,9 @@ namespace SceneUtil { osg::ComputeBoundsVisitor computeBound; computeBound.setTraversalMask(~partsysMask); - node->accept(computeBound); + // We want the bounds of all children of the node, ignoring the node's local transformation + // So do a traverse(), not accept() + computeBound.traverse(*node); // PositionAttitudeTransform seems to be slightly faster than MatrixTransform osg::ref_ptr trans(new SceneUtil::PositionAttitudeTransform);