Added prelimnary KdTree data structure and automatic kdtree build support

into osgDB::Registry/osgTerrain so that newly created subgraphs can have 
KdTree built on all osg::Geometry automatically on load/creation.
This commit is contained in:
Robert Osfield
2008-07-04 15:57:48 +00:00
parent bc1032653c
commit 44d144997e
8 changed files with 315 additions and 11 deletions

View File

@@ -642,6 +642,15 @@ void GeometryTechnique::generateGeometry(Locator* masterLocator, const osg::Vec3
//geometry->setUseDisplayList(false);
geometry->setUseVertexBufferObjects(true);
if (osgDB::Registry::instance()->getBuildKdTreesHint()==osgDB::ReaderWriter::Options::BUILD_KDTREES &&
osgDB::Registry::instance()->getKdTreeBuilder())
{
//osg::notify(osg::NOTICE)<<"osgTerrain::GeometryTechnique::build kd tree"<<std::endl;
buffer._geode->accept(*(osgDB::Registry::instance()->getKdTreeBuilder()));
//osg::notify(osg::NOTICE)<<"after"<<std::endl;
}
}
void GeometryTechnique::applyColorLayers()