X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FScenery%2Fhitlist.cxx;h=bb980823b5bb422b8d55b47dec055baa850b2879;hb=9fac7682e3a63266f0d431a6d9a99433d398c0c0;hp=db95620a754613b8d918da38cdb85db16a50a0ed;hpb=3d47d2284e65100df449b8aad30bd1048f68a06a;p=flightgear.git diff --git a/src/Scenery/hitlist.cxx b/src/Scenery/hitlist.cxx index db95620a7..bb980823b 100644 --- a/src/Scenery/hitlist.cxx +++ b/src/Scenery/hitlist.cxx @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include @@ -53,7 +53,7 @@ static bool sgdPointInTriangle( sgdVec3 point, sgdVec3 tri[3] ) //first, drop the smallest dimension so we only have to work //in 2d. double x1, y1, x2, y2, x3, y3, rx, ry; - if ( fabs(min_dim-dx) <= FG_EPSILON ) { + if ( fabs(min_dim-dx) <= SG_EPSILON ) { // x is the smallest dimension x1 = point[1]; y1 = point[2]; @@ -63,7 +63,7 @@ static bool sgdPointInTriangle( sgdVec3 point, sgdVec3 tri[3] ) y3 = tri[1][2]; rx = tri[2][1]; ry = tri[2][2]; - } else if ( fabs(min_dim-dy) <= FG_EPSILON ) { + } else if ( fabs(min_dim-dy) <= SG_EPSILON ) { // y is the smallest dimension x1 = point[0]; y1 = point[2]; @@ -73,7 +73,7 @@ static bool sgdPointInTriangle( sgdVec3 point, sgdVec3 tri[3] ) y3 = tri[1][2]; rx = tri[2][0]; ry = tri[2][2]; - } else if ( fabs(min_dim-dz) <= FG_EPSILON ) { + } else if ( fabs(min_dim-dz) <= SG_EPSILON ) { // z is the smallest dimension x1 = point[0]; y1 = point[1]; @@ -222,7 +222,9 @@ void FGHitList::IntersectBranch( ssgBranch *branch, sgdMat4 m, center[2] = fcenter[2]; sgdXformPnt3( center, m ) ; double radius_sqd = bsphere->getRadius() * bsphere->getRadius(); - if ( sgdPointLineDistSquared( center, orig, dir ) < radius_sqd ) { + if ( sgdClosestPointToLineDistSquared( center, orig, dir ) < + radius_sqd ) + { // possible intersections if ( kid->isAKindOf ( ssgTypeBranch() ) ) { sgdMat4 m_new; @@ -295,7 +297,9 @@ void FGHitList::IntersectCachedLeaf( sgdMat4 m, sgdSetMat4( m, fxform ); sgdXformPnt3( center, m ); - if ( sgdPointLineDistSquared( center, orig, dir ) < radius*radius ) { + if ( sgdClosestPointToLineDistSquared( center, orig, dir ) < + radius*radius ) + { IntersectLeaf( (ssgLeaf *)last_hit(), m, orig, dir ); } }