Fix handling of in-scenegraph Drawables in osgShadow
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user