Fix handling of in-scenegraph Drawables in osgShadow

This commit is contained in:
scrawl
2017-02-03 18:01:08 +01:00
parent e38c3d0303
commit fdf6d55b9d
2 changed files with 7 additions and 22 deletions

View File

@@ -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; i<geode.getNumDrawables(); ++i)
{
osg::Drawable* drawable = geode.getDrawable(i);
apply(&drawable);
if (drawable->getStateSet()) pushState(drawable->getStateSet());
apply(geode.getDrawable(i));
if (drawable->getStateSet()) popState();
}
if (geode.getStateSet()) popState();
if (drawable.getStateSet()) popState();
}
void pushState(osg::StateSet* stateset)

View File

@@ -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; i<node.getNumDrawables();++i)
{
if (node.getDrawable(i))
{
updateBound(node.getDrawable(i)->getBoundingBox());
}
}
updateBound(drawable.getBoundingBox());
// pop the culling mode.
popCurrentMask();