From fdf6d55b9da38e7a77b8557c4562767e89b8e33b Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 3 Feb 2017 18:01:08 +0100 Subject: [PATCH] Fix handling of in-scenegraph Drawables in osgShadow --- src/osgShadow/OccluderGeometry.cpp | 17 ++++------------- src/osgShadow/ViewDependentShadowMap.cpp | 12 +++--------- 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/src/osgShadow/OccluderGeometry.cpp b/src/osgShadow/OccluderGeometry.cpp index 178e17041..4189f0f12 100644 --- a/src/osgShadow/OccluderGeometry.cpp +++ b/src/osgShadow/OccluderGeometry.cpp @@ -77,22 +77,13 @@ public: if (transform.getStateSet()) popState(); } - void apply(osg::Geode& geode) + void apply(osg::Drawable& drawable) { - if (geode.getStateSet()) pushState(geode.getStateSet()); + if (drawable.getStateSet()) pushState(drawable.getStateSet()); - for(unsigned int i=0; igetStateSet()) pushState(drawable->getStateSet()); - - apply(geode.getDrawable(i)); - - if (drawable->getStateSet()) popState(); - } - - if (geode.getStateSet()) popState(); + if (drawable.getStateSet()) popState(); } void pushState(osg::StateSet* stateset) diff --git a/src/osgShadow/ViewDependentShadowMap.cpp b/src/osgShadow/ViewDependentShadowMap.cpp index 6336662aa..f72f2ce15 100644 --- a/src/osgShadow/ViewDependentShadowMap.cpp +++ b/src/osgShadow/ViewDependentShadowMap.cpp @@ -274,20 +274,14 @@ public: popCurrentMask(); } - void apply(osg::Geode& node) + void apply(osg::Drawable& drawable) { - if (isCulled(node)) return; + if (isCulled(drawable)) return; // push the culling mode. pushCurrentMask(); - for(unsigned int i=0; igetBoundingBox()); - } - } + updateBound(drawable.getBoundingBox()); // pop the culling mode. popCurrentMask();