[osg-users] IntersectionVisitor and USE_EYE_POINT_FOR_LOD_LEVEL_SELECTION

Robert Osfield robert.osfield at gmail.com
Wed Nov 30 00:32:50 PST 2016


Hi Nick,

The IntersectionVisitor generally picks the highlest available level
of detail to make sure it gets the most accurate results.  Once I have
some time available I will have a look at your change and consider the
issue.

Robert.

On 30 November 2016 at 00:09, Trajce Nikolov NICK
<trajce.nikolov.nick at gmail.com> wrote:
> 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
>
> _______________________________________________
> 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