From 9b7678138f02717d2b9d6bd287724d69c688ed3f Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sun, 6 Feb 2005 10:14:26 +0000 Subject: [PATCH] Changed the LightSource::setReferenceFrame() read code so that it doesn't enable the culling active flag if its was already set to false. --- src/osgPlugins/osg/LightSource.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/osgPlugins/osg/LightSource.cpp b/src/osgPlugins/osg/LightSource.cpp index d7b8e51b7..d54fe4973 100644 --- a/src/osgPlugins/osg/LightSource.cpp +++ b/src/osgPlugins/osg/LightSource.cpp @@ -29,6 +29,8 @@ bool LightSource_readLocalData(Object& obj, Input& fr) if (fr[0].matchWord("referenceFrame")) { + bool cullingActiveBefore = lightsource.getCullingActive(); + if (fr[1].matchWord("RELATIVE_TO_ABSOLUTE") || fr[1].matchWord("ABSOLUTE")) { lightsource.setReferenceFrame(LightSource::ABSOLUTE_RF); @@ -41,6 +43,12 @@ bool LightSource_readLocalData(Object& obj, Input& fr) fr += 2; iteratorAdvanced = true; } + + // if culling wasn't before reset it to off. + if (!cullingActiveBefore && lightsource.getCullingActive()) + { + lightsource.setCullingActive(cullingActiveBefore); + } } osg::ref_ptr sa=fr.readStateAttribute();