[osg-users] getDistanceToViewPoint not implemented in osgUtil::IntersectionVisitor

Robert Osfield robert.osfield at gmail.com
Thu Mar 19 01:39:25 PDT 2009


Hi Jason,

This change would be appropriate.  Although we might want to review the eye
point management, and perhaps eye + view points as potentially they aren't
the same.  An stack for eye/viewpoint point might be need as well to cope
with internal camera nodes.

Robert.

2009/3/18 Jason Beverage <jasonbeverage at gmail.com>

> Hi Robert,
>
> I'm using LOD's in one of my apps to control the distance at which models
> first begin to appear and noticed that the IntersectionVisitor will still
> hit these nodes even if they are not visible.
>
> I tried setting the LODSelectionMode to
> USE_EYE_POINT_FOR_LOD_LEVEL_SELECTION but it still selected invisible
> nodes.  After looking through the code I noticed that the
> getDistanceToViewPoint function is used by the LOD class but is not
> implemented by the IntersectionVisitor, so will always have the value of 0.
>
> I made a small class deriving from IntersectionVisitor that just returned
> getDistanceToEyePoint (which is overriden by IntersectionVisitor) and things
> seemed to behave more appropriately.
>
> class MyIntersectionVisitor : public osgUtil::IntersectionVisitor
> {
> public:
>     MyIntersectionVisitor(osgUtil::Intersector* intersector=0,
> osgUtil::IntersectionVisitor::ReadCallback* readCallback=0)
>         :IntersectionVisitor(intersector, readCallback)
>     {
>     }
>
>     virtual float getDistanceToViewPoint(const osg::Vec3& pos, bool
> useLODScale) const
>     {
>        return getDistanceToEyePoint(pos, useLODScale);
>     }
> };
>
> Would this change, or something similar, be appropriate for inclusions in
> OSG?
>
> Thanks!
>
> Jason
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20090319/58d81f19/attachment-0003.htm>


More information about the osg-users mailing list