[osg-users] IntersectionVisitor and PagedLOD

Robert Osfield robert.osfield at gmail.com
Mon Sep 3 03:02:14 PDT 2007


Hi Serge,

IntersectionVisitor isn't cast in concrete so I'm open to suggestions.
 I don't really know the motivation as I don't know about your the
particulars of your app.  I am a bit concerned about bloating
IntersectionVisitor with lots of specific usage case tweaks though.  I
don't know if it would be possible you to solve your problem another
way.  Feel free to make changes to IntersectionVisitor and submit them
for review - at least then I'd be able to mull over how intrusive the
changes might be.

Robert.

On 9/3/07, Serge Lages <serge.lages at gmail.com> wrote:
> 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
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>



More information about the osg-users mailing list