[osg-users] IntersectionVisitor and USE_EYE_POINT_FOR_LOD_LEVEL_SELECTION

Trajce Nikolov NICK trajce.nikolov.nick at gmail.com
Tue Nov 29 16:09:26 PST 2016


Hi again Robert,

attached is the mods to make it work with USE_EYE_POINT_FOR_LOD_LEVEL_SELECTION
 too when traversing the PagedLODs. For my end it works. I would make a
pull request but stuck with 3.5.5 and it is two additional lines of code.
Please review...

Thanks and cheers!
Nick

On Tue, Nov 29, 2016 at 11:34 PM, Trajce Nikolov NICK <
trajce.nikolov.nick at gmail.com> wrote:

> Hi Robert,
>
> USE_EYE_POINT_FOR_LOD_LEVEL_SELECTION seams to not have effect no matter
> if it is selected or not. I traced the code and as is written now
> IntersectionVisitor::apply(osg::PagedLOD& plod) is working always with
> the highest res.
>
> // Perform an intersection test only on children that display
> // at the maximum resolution.
>
> I need this functionality to be able to pick on the level of detail based
> on the distance from the eyepoint. I am seeing there is a override for that
> but it is never used
>
> float IntersectionVisitor::getDistanceToEyePoint(const osg::Vec3& pos,
> bool /*withLODScale*/) const
> {
>     if (_lodSelectionMode==USE_EYE_POINT_FOR_LOD_LEVEL_SELECTION)
>     {
>         return (pos-getEyePoint()).length();
>     }
>     else
>     {
>         return 0.0f;
>     }
> }
>
> If you are very busy and give some hints I can try to implement this
> functionality
>
> Thanks a lot!
>
> --
> trajce nikolov nick
>



-- 
trajce nikolov nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20161130/792bbf99/attachment-0003.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: IntersectionVisitor.cpp
Type: text/x-c++src
Size: 15977 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20161130/792bbf99/attachment-0003.cpp>


More information about the osg-users mailing list