[osg-users] LineOfSight intersection returning geometry

Robert Osfield robert.osfield at gmail.com
Thu Jan 21 00:40:54 PST 2016


Hi Tony,

The TraversalMask is part of the osg::NodeVisitor base class, so simply do:

   intersectionVisitor.setTraversalMask(0x01);

Cheers,
Robert.

On 21 January 2016 at 07:57, Tony Vasile <minghia at gmail.com> wrote:
> Okay so I found this code:
>
>
> Code:
>
> osg::ref_ptr<osgUtil::IntersectorGroup> intersectorGroup = new osgUtil::IntersectorGroup();
>
>         for(unsigned int r=0; r<numRows; ++r)
>         {
>             for(unsigned int c=0; c<numColumns; ++c)
>             {
>                 osg::Vec3d s = start + deltaColumn * double(c) + deltaRow * double(r);
>                 osg::Vec3d e = end + deltaColumn * double(c) + deltaRow * double(r);
>                 osg::ref_ptr<osgUtil::LineSegmentIntersector> intersector = new osgUtil::LineSegmentIntersector(s, e);
>                 intersectorGroup->addIntersector( intersector.get() );
>             }
>         }
>
>
>         osgUtil::IntersectionVisitor intersectVisitor( intersectorGroup.get(), new MyReadCallback );
>         scene->accept(intersectVisitor);
>
>
>  in the osgintersections.cpp example. One thing that I can't find is how do I set a traversal mask?
>
> Tony
>
> ------------------------
> Tony V
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=66069#66069
>
>
>
>
>
> _______________________________________________
> 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