[osg-users] getDistanceToViewPoint not implemented in osgUtil::IntersectionVisitor
jasonbeverage at gmail.com
Wed Mar 18 12:00:02 PDT 2009
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
virtual float getDistanceToViewPoint(const osg::Vec3& pos, bool
return getDistanceToEyePoint(pos, useLODScale);
Would this change, or something similar, be appropriate for inclusions in
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the osg-users