Beispiel #1
0
void ShapesToGeometriesVisitor::apply( osg::Geode& geode )
{
    for(unsigned int i=0; i<geode.getNumDrawables(); ++i)
    {
        osg::ShapeDrawable* drawable = dynamic_cast<osg::ShapeDrawable*>( geode.getDrawable(i) );
        if(drawable==NULL)
            continue;
        osg::Geometry* newGeom = convertShapeToGeometry(*(drawable->getShape()), _hints);
        newGeom->setStateSet( drawable->getStateSet() );
        geode.setDrawable( i, newGeom );
    }
    traverse(geode);
}