Added a direct call to the osgUtil::Optimizer in GeoSetBuilder.cpp so that
the resultant geomety would be more efficiently packed.
This commit is contained in:
parent
d7ab56e31f
commit
840ae915e9
@ -27,7 +27,7 @@
|
||||
#include <osg/Point>
|
||||
#include <osg/Notify>
|
||||
|
||||
#include <osgUtil/Tesselator>
|
||||
#include <osgUtil/Optimizer>
|
||||
|
||||
#include <map>
|
||||
#include <algorithm>
|
||||
@ -317,17 +317,11 @@ osg::Geode* GeoSetBuilder::createOsgGeoSets(osg::Geode* geode)
|
||||
assert( stateset == geom->getStateSet() );
|
||||
}
|
||||
|
||||
osgUtil::Tesselator tesselator;
|
||||
for(unsigned int i=0;i<geode->getNumDrawables();++i)
|
||||
{
|
||||
osg::Geometry* geom = dynamic_cast<osg::Geometry*>(geode->getDrawable(i));
|
||||
if (geom)
|
||||
{
|
||||
geom->computeCorrectBindingsAndArraySizes();
|
||||
tesselator.retesselatePolygons(*geom);
|
||||
}
|
||||
}
|
||||
|
||||
osgUtil::Optimizer optimizer;
|
||||
optimizer.optimize(geode, osgUtil::Optimizer::SHARE_DUPLICATE_STATE |
|
||||
osgUtil::Optimizer::MERGE_GEOMETRY |
|
||||
osgUtil::Optimizer::CHECK_GEOMETRY |
|
||||
osgUtil::Optimizer::TESSELATE_GEOMETRY);
|
||||
return geode;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user