openscenegraph / OpenSceneGraph

OpenSceneGraph git repository
http://www.openscenegraph.org
Other
3.21k stars 1.42k forks source link

IntersectionVisitor set LOD selection mode as USE_HIGHEST_LEVEL_OF_DETAIL is not working #1325

Closed ChenKe404 closed 4 months ago

ChenKe404 commented 4 months ago

I want use IntersectionVisitor to do intersection with highest level detail of LOD, so I call setLODSelectionMode(USE_HIGHEST_LEVEL_OF_DETAIL),but the results always the current rang LOD. the code for setting the mode:

    osgUtil::IntersectionVisitor iv;
    osgUtil::PlaneIntersector pi;
    iv.setTraversalMode(osg::NodeVisitor::TRAVERSE_ACTIVE_CHILDREN);  // Neither will TRAVERSE_ALL_CHILDREN
    iv.setLODSelectionMode(osgUtil::IntersectionVisitor::USE_HIGHEST_LEVEL_OF_DETAIL);
    iv.setIntersector(pi);
    iv.apply(*modelnode);  // modelnode is the root node

somebody help?

ChenKe404 commented 4 months ago

OSG version 3.6.5

ChenKe404 commented 4 months ago

I see,I need to set a read callback to read high detail LOD files.