[osg-users] osg::LineSegment intersect with Box and Sphere inconsistency

Wojciech Lewandowski w.p.lewandowski at gmail.com
Mon Apr 27 05:16:31 PDT 2015


Hi Robert,

I am little concerned that some end user code will be using these
> intersects methods and working around their inconsistency, so if we
> fix them then we could end up breaking end user code.


I am one of those users now ;-). However, I adopt easily. Others may not
notice the change, though. Perhaps better solution would be to leave the
functionality as is and clearly rename and/or comment the r1,r2 params to
(rFromStart rFromEnd ?) so that inconsistency is clear and does not
surprise future users ?

Cheers,
Wojtek



2015-04-27 13:28 GMT+02:00 Robert Osfield <robert.osfield at gmail.com>:

> Hi Wojtek,
>
> On 27 April 2015 at 12:15, Wojciech Lewandowski
> <w.p.lewandowski at gmail.com> wrote:
> > I believe both can be correct but it looks like in Box case r1 is ratio
> of
> > segment length measured from start and r2 measured backwards from the
> > segment end. For Sphere both r1 and r2 are measured from start. So here
> is
> > the inconsistency...
>
> This is my assessment too.
>
> I have #if def'd out the LineSegment::intersect(const BoundingBox&
> bb,float& r1,float& r2) style methods from LineSegment and have been
> able to compile the whole OSG, so it looks like these methods have
> been written but not used and tested by the OSG itself so the errors
> haven't been picked up.
>
> This leaves us with deciding what to do with these erroneous methods.
> One route is to remove them, another is to change their behaviour so
> it's consistent and document this change.  To make the method
> consistent I feel that they should return the ratio between the start
> and end points, measured from the start.
>
> I am little concerned that some end user code will be using these
> intersects methods and working around their inconsistency, so if we
> fix them then we could end up breaking end user code.
>
> Robert.
> _______________________________________________
> 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/20150427/174cad99/attachment-0003.htm>


More information about the osg-users mailing list