Permalink
Browse files

Fix handling of in-scenegraph Drawables in osgShadow

  • Loading branch information...
1 parent e38c3d0 commit fdf6d55b9da38e7a77b8557c4562767e89b8e33b @scrawl scrawl committed Feb 3, 2017
Showing with 7 additions and 22 deletions.
  1. +4 −13 src/osgShadow/OccluderGeometry.cpp
  2. +3 −9 src/osgShadow/ViewDependentShadowMap.cpp
@@ -77,22 +77,13 @@ class CollectOccludersVisitor : public osg::NodeVisitor
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; i<geode.getNumDrawables(); ++i)
- {
- osg::Drawable* drawable = geode.getDrawable(i);
-
- if (drawable->getStateSet()) pushState(drawable->getStateSet());
-
- apply(geode.getDrawable(i));
-
- if (drawable->getStateSet()) popState();
- }
+ apply(&drawable);
- if (geode.getStateSet()) popState();
+ if (drawable.getStateSet()) popState();
}
void pushState(osg::StateSet* stateset)
@@ -274,20 +274,14 @@ class ComputeLightSpaceBounds : public osg::NodeVisitor, public osg::CullStack
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; i<node.getNumDrawables();++i)
- {
- if (node.getDrawable(i))
- {
- updateBound(node.getDrawable(i)->getBoundingBox());
- }
- }
+ updateBound(drawable.getBoundingBox());
// pop the culling mode.
popCurrentMask();

0 comments on commit fdf6d55

Please sign in to comment.