[osg-users] Parameter "ratio" in osgUtil::LineSegmentIntersector::Intersection

Andreas Goebel a-goebel at gmx.de
Tue Sep 30 00:22:06 PDT 2008


I need to sort out intersections that are very close to each other. So I 
took a look at the LineSegmentIntersector::Intersection definition:

            bool operator < (const Intersection& rhs) const { return 
ratio < rhs.ratio; }

            typedef std::vector<unsigned int>   IndexList;
            typedef std::vector<double>         RatioList;

            double                          ratio;

and saw that there is a ratio-parameter for sorting.

What is that ratio-parameter expressing? May I assume that points which 
are very close to each other do have a ratio that is very close?
I guess that the other direction is not true: Points with a close ratio 
might be apart.

So what I would do if my assumptions are true is first to test if an 
intersection has a close ratio to the intersection before in the list. 
If this is true, then I will test the distance.



More information about the osg-users mailing list