[osg-users] IntersectionVisitor and PagedLOD

Serge Lages serge.lages at gmail.com
Mon Sep 3 02:38:45 PDT 2007


Hi Robert,

I have a request about the new IntersectionVisitor and how it interacts with
a PagedLOD.
Currently it only traverse the highest resolution child (from
IntersectionVisitor.cpp):

void IntersectionVisitor::apply(osg:PagedLOD& plod)
{
   if (!enter(plod)) return;

   if (plod.getNumFileNames()>0)
   {
       osg::ref_ptr<osg::Node> highestResChild;

       if (plod.getNumFileNames() != plod.getNumChildren() &&
_readCallback.valid())
       {
           highestResChild = _readCallback->readNodeFile(
plod.getDatabasePath() + plod.getFileName(plod.getNumFileNames()-1) );
       }
       else if (plod.getNumChildren()>0)
       {
           highestResChild = plod.getChild( plod.getNumChildren()-1 );
       }

       if (highestResChild.valid())
       {
           highestResChild->accept(*this);
       }
   }

   leave();
}

In my app, I have a custom PagedLOD which is organised differently than the
original one. And I would like the IntersectionVisitor to directly traverse
the PagedLOD node (like the LOD node for example):

if (!enter(lod)) return;

traverse(lod);

leave();

That is why I am wondering if it is possible to add an option to the
IntersectionVisitor like setTraverseOnlyHighestPLODChild(bool). By default
it should be setted to true of course.
Or should it be better to add such an option directly to PagedLOD and make
the IntersectionVisitor check for it on each PagedLOD visited ?

-- 
Serge Lages
http://www.magrathea-engine.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20070903/2fa2d72a/attachment-0002.htm>


More information about the osg-users mailing list