]> git.mxchange.org Git - flightgear.git/blobdiff - src/Scenery/hitlist.cxx
inlines.h -> sg_inlines.h
[flightgear.git] / src / Scenery / hitlist.cxx
index 957a4e7a926ef7bbfc49065ac88fc8969714a5bc..bb980823b5bb422b8d55b47dec055baa850b2879 100644 (file)
@@ -6,12 +6,13 @@
 #  include <windows.h>
 #endif
 
+#include <float.h>
 #include <math.h>
 
 #include <GL/glut.h>
 
 #include <simgear/constants.h>
-#include <simgear/inlines.h>
+#include <simgear/sg_inlines.h>
 #include <simgear/math/vector.hxx>
 #include <simgear/xgl/xgl.h>
 
@@ -52,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];
@@ -62,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];
@@ -72,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];
@@ -221,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;
@@ -294,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 );
        }
     }