Fix handling of in-scenegraph Drawables in SmoothingVisitor, TriStripVisitor and GraphicsCostEstimator
This commit is contained in:
@@ -205,15 +205,10 @@ public:
|
||||
traverse(node);
|
||||
}
|
||||
|
||||
virtual void apply(osg::Geode& geode)
|
||||
virtual void apply(osg::Geometry& geom)
|
||||
{
|
||||
apply(geode.getStateSet());
|
||||
for(unsigned int i=0; i<geode.getNumDrawables(); ++i)
|
||||
{
|
||||
apply(geode.getDrawable(i)->getStateSet());
|
||||
osg::Geometry* geometry = geode.getDrawable(i)->asGeometry();
|
||||
if (geometry) apply(geometry);
|
||||
}
|
||||
apply(geom.getStateSet());
|
||||
apply(&geom);
|
||||
}
|
||||
|
||||
void apply(osg::StateSet* stateset)
|
||||
@@ -282,15 +277,10 @@ public:
|
||||
traverse(node);
|
||||
}
|
||||
|
||||
virtual void apply(osg::Geode& geode)
|
||||
virtual void apply(osg::Geometry& geom)
|
||||
{
|
||||
apply(geode.getStateSet());
|
||||
for(unsigned int i=0; i<geode.getNumDrawables(); ++i)
|
||||
{
|
||||
apply(geode.getDrawable(i)->getStateSet());
|
||||
osg::Geometry* geometry = geode.getDrawable(i)->asGeometry();
|
||||
if (geometry) apply(geometry);
|
||||
}
|
||||
apply(geom.getStateSet());
|
||||
apply(&geom);
|
||||
}
|
||||
|
||||
void apply(osg::StateSet* stateset)
|
||||
|
||||
@@ -702,11 +702,7 @@ void SmoothingVisitor::smooth(osg::Geometry& geom, double creaseAngle)
|
||||
}
|
||||
|
||||
|
||||
void SmoothingVisitor::apply(osg::Geode& geode)
|
||||
void SmoothingVisitor::apply(osg::Geometry& geom)
|
||||
{
|
||||
for(unsigned int i = 0; i < geode.getNumDrawables(); i++ )
|
||||
{
|
||||
osg::Geometry* geom = dynamic_cast<osg::Geometry*>(geode.getDrawable(i));
|
||||
if (geom) smooth(*geom, _creaseAngle);
|
||||
}
|
||||
smooth(geom, _creaseAngle);
|
||||
}
|
||||
|
||||
@@ -629,11 +629,7 @@ void TriStripVisitor::stripify()
|
||||
}
|
||||
}
|
||||
|
||||
void TriStripVisitor::apply(Geode& geode)
|
||||
void TriStripVisitor::apply(Geometry& geom)
|
||||
{
|
||||
for(unsigned int i = 0; i < geode.getNumDrawables(); ++i )
|
||||
{
|
||||
osg::Geometry* geom = dynamic_cast<osg::Geometry*>(geode.getDrawable(i));
|
||||
if (geom) _geometryList.insert(geom);
|
||||
}
|
||||
_geometryList.insert(&geom);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user