Added methods to support isNaN,isInfinte and valid to osg::Vec* and osg::Math,

and added a guard to IntersectVisitor which uses these new methods to prevent
invalid segments being added.
This commit is contained in:
Robert Osfield
2001-11-06 10:34:51 +00:00
parent b45aa55555
commit 5e6153b428
8 changed files with 89 additions and 4 deletions

View File

@@ -217,6 +217,14 @@ bool IntersectVisitor::hits()
void IntersectVisitor::addLineSegment(LineSegment* seg)
{
if (!seg) return;
if (!seg->valid())
{
notify(WARN)<<"Warning: invalid line segment passed to IntersectVisitor::addLineSegment(..), segment ignored.."<<endl;
return;
}
// first check to see if segment has already been added.
for(LineSegmentHitListMap::iterator itr = _segHitList.begin();
itr != _segHitList.end();