# 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>
//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];
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];
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];
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;
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 );
}
}