[osg-users] Update Optimization
Robert Osfield
robert.osfield at gmail.com
Tue Jul 15 02:33:35 PDT 2008
Hi John,
On Tue, Jul 15, 2008 at 2:48 AM, John Burgess
<john.burgess at rocketmail.com> wrote:
>
> I've tried the KdTree but my update traversal rate is still the same as
> before. Below is my code snippet to enable KdTree, am I doing the right
> thing?
>
> osgDB::Registry::instance()->setBuildKdTreesHint(osgDB::ReaderWriter::Options::BUILD_KDTREES);
>
> // Load the terrain
>
> osg::Node* _terrain = osgDB::readNodeFile(terrainFile);
You have to use osgUtil::IntersectionVisitor + LineSegmentIntersector
to take advantage of the new KdTree intersections, the old (and
deprecated) osgUtil::IntersectVisitor does not support KdTree
intersection.
Robert.
More information about the osg-users
mailing list