FG_ to SG_ namespace changes.
This commit is contained in:
parent
0b31b493d3
commit
7ad217b1f1
13 changed files with 58 additions and 58 deletions
|
@ -113,7 +113,7 @@ static FGPolygon rwy_section_tex_coords( const FGPolygon& in_poly,
|
|||
while ( course < -360 ) { course += 360; }
|
||||
while ( course > 360 ) { course -= 360; }
|
||||
// cout << "Dist = " << dist << endl;
|
||||
// cout << " Course = " << course * 180.0 / FG_PI << endl;
|
||||
// cout << " Course = " << course * 180.0 / SG_PI << endl;
|
||||
|
||||
//
|
||||
// 3. Convert from polar to cartesian coordinates
|
||||
|
@ -515,10 +515,10 @@ static void gen_runway_section( const FGRunway& rwy_info,
|
|||
Point3D a3 = runway.get_pt(0, 3);
|
||||
|
||||
if ( startl_pct > 0.0 ) {
|
||||
startl_pct -= nudge * FG_EPSILON;
|
||||
startl_pct -= nudge * SG_EPSILON;
|
||||
}
|
||||
if ( endl_pct < 1.0 ) {
|
||||
endl_pct += nudge * FG_EPSILON;
|
||||
endl_pct += nudge * SG_EPSILON;
|
||||
}
|
||||
|
||||
if ( endl_pct > 1.0 ) {
|
||||
|
@ -532,10 +532,10 @@ static void gen_runway_section( const FGRunway& rwy_info,
|
|||
// with polygon slivers.
|
||||
if ( startw_pct > 0.0 || endw_pct < 1.0 ) {
|
||||
if ( startw_pct > 0.0 ) {
|
||||
startw_pct -= nudge * FG_EPSILON;
|
||||
startw_pct -= nudge * SG_EPSILON;
|
||||
}
|
||||
if ( endw_pct < 1.0 ) {
|
||||
endw_pct += nudge * FG_EPSILON;
|
||||
endw_pct += nudge * SG_EPSILON;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ bool test_point(Point3D Pa, Point3D Pb, Point3D Pc) {
|
|||
|
||||
// printf("a1 = %.2f a2 = %.2f\n", a1 * RAD_TO_DEG, a2 * RAD_TO_DEG);
|
||||
|
||||
return ( (a1 + a2) < FG_PI );
|
||||
return ( (a1 + a2) < SG_PI );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -83,8 +83,8 @@ FGPolygon gen_area(Point3D origin, double angle, const FGPolygon& cart_list) {
|
|||
for ( i = 0; i < rad_list.contour_size( 0 ); ++i) {
|
||||
p = rad_list.get_pt( 0, i );
|
||||
double theta = p.y() + angle;
|
||||
while ( theta < FG_2PI ) {
|
||||
theta += FG_2PI;
|
||||
while ( theta < SG_2PI ) {
|
||||
theta += SG_2PI;
|
||||
}
|
||||
p.sety( theta );
|
||||
rad_list.set_pt( 0, i, p );
|
||||
|
|
|
@ -119,8 +119,8 @@ bool FGClipper::load_polys(const string& path) {
|
|||
in >> lastx;
|
||||
in >> lasty;
|
||||
|
||||
if ( (fabs(startx - lastx) < FG_EPSILON)
|
||||
&& (fabs(starty - lasty) < FG_EPSILON) ) {
|
||||
if ( (fabs(startx - lastx) < SG_EPSILON)
|
||||
&& (fabs(starty - lasty) < SG_EPSILON) ) {
|
||||
// last point same as first, discard
|
||||
} else {
|
||||
p = Point3D( lastx, lasty, 0.0 );
|
||||
|
@ -185,7 +185,7 @@ void FGClipper::move_slivers( FGPolygon& in, FGPolygon& out ) {
|
|||
/* cout << " min_angle (rad) = "
|
||||
<< min_angle << endl;
|
||||
cout << " min_angle (deg) = "
|
||||
<< min_angle * 180.0 / FG_PI << endl;
|
||||
<< min_angle * 180.0 / SG_PI << endl;
|
||||
cout << " area = " << area << endl; */
|
||||
|
||||
if ( ((min_angle < angle_cutoff) && (area < area_cutoff)) ||
|
||||
|
|
|
@ -83,7 +83,7 @@ int_list FGGenOutput::calc_tex_coords( FGConstruct& c, point_list geod_nodes,
|
|||
double clat_rad = clat * DEG_TO_RAD;
|
||||
double cos_lat = cos( clat_rad );
|
||||
double local_radius = cos_lat * EQUATORIAL_RADIUS_M;
|
||||
double local_perimeter = 2.0 * local_radius * FG_PI;
|
||||
double local_perimeter = 2.0 * local_radius * SG_PI;
|
||||
double degree_width = local_perimeter / 360.0;
|
||||
|
||||
// cout << "clat = " << clat << endl;
|
||||
|
@ -93,7 +93,7 @@ int_list FGGenOutput::calc_tex_coords( FGConstruct& c, point_list geod_nodes,
|
|||
// cout << "local_perimeter = " << local_perimeter << endl;
|
||||
// cout << "degree_width = " << degree_width << endl;
|
||||
|
||||
double perimeter = 2.0 * EQUATORIAL_RADIUS_M * FG_PI;
|
||||
double perimeter = 2.0 * EQUATORIAL_RADIUS_M * SG_PI;
|
||||
double degree_height = perimeter / 360.0;
|
||||
// cout << "degree_height = " << degree_height << endl;
|
||||
|
||||
|
@ -138,10 +138,10 @@ int_list FGGenOutput::calc_tex_coords( FGConstruct& c, point_list geod_nodes,
|
|||
t.setx( p.x() * ( degree_width / FG_STANDARD_TEXTURE_DIMENSION ) );
|
||||
t.sety( p.y() * ( degree_height / FG_STANDARD_TEXTURE_DIMENSION ) );
|
||||
shifted_t = t - min;
|
||||
if ( shifted_t.x() < FG_EPSILON ) {
|
||||
if ( shifted_t.x() < SG_EPSILON ) {
|
||||
shifted_t.setx( 0.0 );
|
||||
}
|
||||
if ( shifted_t.y() < FG_EPSILON ) {
|
||||
if ( shifted_t.y() < SG_EPSILON ) {
|
||||
shifted_t.sety( 0.0 );
|
||||
}
|
||||
shifted_t.setz( 0.0 );
|
||||
|
|
|
@ -650,16 +650,16 @@ static Point3D calc_normal( FGConstruct& c, int i ) {
|
|||
// cout << " " << p1 << endl;
|
||||
// cout << " " << p2 << endl;
|
||||
// cout << " " << p3 << endl;
|
||||
if ( fabs(p1.x() - p2.x()) < FG_EPSILON &&
|
||||
fabs(p1.x() - p3.x()) < FG_EPSILON ) {
|
||||
if ( fabs(p1.x() - p2.x()) < SG_EPSILON &&
|
||||
fabs(p1.x() - p3.x()) < SG_EPSILON ) {
|
||||
degenerate = true;
|
||||
}
|
||||
if ( fabs(p1.y() - p2.y()) < FG_EPSILON &&
|
||||
fabs(p1.y() - p3.y()) < FG_EPSILON ) {
|
||||
if ( fabs(p1.y() - p2.y()) < SG_EPSILON &&
|
||||
fabs(p1.y() - p3.y()) < SG_EPSILON ) {
|
||||
degenerate = true;
|
||||
}
|
||||
if ( fabs(p1.z() - p2.z()) < FG_EPSILON &&
|
||||
fabs(p1.z() - p3.z()) < FG_EPSILON ) {
|
||||
if ( fabs(p1.z() - p2.z()) < SG_EPSILON &&
|
||||
fabs(p1.z() - p3.z()) < SG_EPSILON ) {
|
||||
degenerate = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -331,46 +331,46 @@ void FGMatch::split_tile( FGConstruct& c ) {
|
|||
Point3D node = nodes[i];
|
||||
Point3D normal = point_normals[i];
|
||||
|
||||
if ( (fabs(node.y() - min.y) < FG_EPSILON) &&
|
||||
(fabs(node.x() - min.x) < FG_EPSILON) ) {
|
||||
if ( (fabs(node.y() - min.y) < SG_EPSILON) &&
|
||||
(fabs(node.x() - min.x) < SG_EPSILON) ) {
|
||||
if ( ! sw_flag ) {
|
||||
sw_node = node;
|
||||
sw_normal = normal;
|
||||
}
|
||||
} else if ( (fabs(node.y() - min.y) < FG_EPSILON) &&
|
||||
(fabs(node.x() - max.x) < FG_EPSILON) ) {
|
||||
} else if ( (fabs(node.y() - min.y) < SG_EPSILON) &&
|
||||
(fabs(node.x() - max.x) < SG_EPSILON) ) {
|
||||
if ( ! se_flag ) {
|
||||
se_node = node;
|
||||
se_normal = normal;
|
||||
}
|
||||
} else if ( (fabs(node.y() - max.y) < FG_EPSILON) &&
|
||||
(fabs(node.x() - max.x) < FG_EPSILON)) {
|
||||
} else if ( (fabs(node.y() - max.y) < SG_EPSILON) &&
|
||||
(fabs(node.x() - max.x) < SG_EPSILON)) {
|
||||
if ( ! ne_flag ) {
|
||||
ne_node = node;
|
||||
ne_normal = normal;
|
||||
}
|
||||
} else if ( (fabs(node.y() - max.y) < FG_EPSILON) &&
|
||||
(fabs(node.x() - min.x) < FG_EPSILON) ) {
|
||||
} else if ( (fabs(node.y() - max.y) < SG_EPSILON) &&
|
||||
(fabs(node.x() - min.x) < SG_EPSILON) ) {
|
||||
if ( ! nw_flag ) {
|
||||
nw_node = node;
|
||||
nw_normal = normal;
|
||||
}
|
||||
} else if ( fabs(node.x() - min.x) < FG_EPSILON ) {
|
||||
} else if ( fabs(node.x() - min.x) < SG_EPSILON ) {
|
||||
if ( ! west_flag ) {
|
||||
west_nodes.push_back( node );
|
||||
west_normals.push_back( normal );
|
||||
}
|
||||
} else if ( fabs(node.x() - max.x) < FG_EPSILON ) {
|
||||
} else if ( fabs(node.x() - max.x) < SG_EPSILON ) {
|
||||
if ( ! east_flag ) {
|
||||
east_nodes.push_back( node );
|
||||
east_normals.push_back( normal );
|
||||
}
|
||||
} else if ( fabs(node.y() - min.y) < FG_EPSILON ) {
|
||||
} else if ( fabs(node.y() - min.y) < SG_EPSILON ) {
|
||||
if ( ! south_flag ) {
|
||||
south_nodes.push_back( node );
|
||||
south_normals.push_back( normal );
|
||||
}
|
||||
} else if ( fabs(node.y() - max.y) < FG_EPSILON ) {
|
||||
} else if ( fabs(node.y() - max.y) < SG_EPSILON ) {
|
||||
if ( ! north_flag ) {
|
||||
north_nodes.push_back( node );
|
||||
north_normals.push_back( normal );
|
||||
|
@ -395,20 +395,20 @@ void FGMatch::split_tile( FGConstruct& c ) {
|
|||
p1 = nodes[ seg.get_n1() ];
|
||||
p2 = nodes[ seg.get_n2() ];
|
||||
|
||||
if ( fabs(p1.y() - p2.y()) < FG_EPSILON ) {
|
||||
if ( fabs(p1.y() - p2.y()) < SG_EPSILON ) {
|
||||
// check if horizontal
|
||||
if ( fabs(p1.y() - max.y) < FG_EPSILON ) {
|
||||
if ( fabs(p1.y() - max.y) < SG_EPSILON ) {
|
||||
north_segs.push_back( seg );
|
||||
} else if ( fabs(p1.y() - min.y) < FG_EPSILON ) {
|
||||
} else if ( fabs(p1.y() - min.y) < SG_EPSILON ) {
|
||||
south_segs.push_back( seg );
|
||||
} else {
|
||||
body_segs.push_back( seg );
|
||||
}
|
||||
} else if ( fabs(p1.x() - p2.x()) < FG_EPSILON ) {
|
||||
} else if ( fabs(p1.x() - p2.x()) < SG_EPSILON ) {
|
||||
// check if vertical
|
||||
if ( fabs(p1.x() - max.x) < FG_EPSILON ) {
|
||||
if ( fabs(p1.x() - max.x) < SG_EPSILON ) {
|
||||
east_segs.push_back( seg );
|
||||
} else if ( fabs(p1.x() - min.x) < FG_EPSILON ) {
|
||||
} else if ( fabs(p1.x() - min.x) < SG_EPSILON ) {
|
||||
west_segs.push_back( seg );
|
||||
} else {
|
||||
body_segs.push_back( seg );
|
||||
|
|
|
@ -416,7 +416,7 @@ double FGArray::interpolate_altitude( double lon, double lat ) const {
|
|||
|
||||
// printf(" zA = %.2f zB = %.2f\n", zA, zB);
|
||||
|
||||
if ( dx > FG_EPSILON ) {
|
||||
if ( dx > SG_EPSILON ) {
|
||||
elev = dy * (zB - zA) / dx + zA;
|
||||
} else {
|
||||
elev = zA;
|
||||
|
@ -448,7 +448,7 @@ double FGArray::interpolate_altitude( double lon, double lat ) const {
|
|||
// printf(" zA = %.2f zB = %.2f\n", zA, zB );
|
||||
// printf(" xB - xA = %.2f\n", col_step * dy / row_step);
|
||||
|
||||
if ( dy > FG_EPSILON ) {
|
||||
if ( dy > SG_EPSILON ) {
|
||||
elev = dx * (zB - zA) / dy + zA;
|
||||
} else {
|
||||
elev = zA;
|
||||
|
|
|
@ -532,7 +532,7 @@ double FGDem::interpolate_altitude( double lon, double lat ) {
|
|||
|
||||
// printf(" zA = %.2f zB = %.2f\n", zA, zB);
|
||||
|
||||
if ( dx > FG_EPSILON ) {
|
||||
if ( dx > SG_EPSILON ) {
|
||||
elev = dy * (zB - zA) / dx + zA;
|
||||
} else {
|
||||
elev = zA;
|
||||
|
@ -564,7 +564,7 @@ double FGDem::interpolate_altitude( double lon, double lat ) {
|
|||
// printf(" zA = %.2f zB = %.2f\n", zA, zB );
|
||||
// printf(" xB - xA = %.2f\n", col_step * dy / row_step);
|
||||
|
||||
if ( dy > FG_EPSILON ) {
|
||||
if ( dy > SG_EPSILON ) {
|
||||
elev = dx * (zB - zA) / dy + zA;
|
||||
} else {
|
||||
elev = zA;
|
||||
|
|
|
@ -48,7 +48,7 @@ extern "C" {
|
|||
// Given a line segment specified by two endpoints p1 and p2, return
|
||||
// the slope of the line.
|
||||
static double slope( const Point3D& p0, const Point3D& p1 ) {
|
||||
if ( fabs(p0.x() - p1.x()) > FG_EPSILON ) {
|
||||
if ( fabs(p0.x() - p1.x()) > SG_EPSILON ) {
|
||||
return (p0.y() - p1.y()) / (p0.x() - p1.x());
|
||||
} else {
|
||||
// return 1.0e+999; // really big number
|
||||
|
@ -80,7 +80,7 @@ static bool intersects( Point3D p0, Point3D p1, double x, Point3D *result ) {
|
|||
|
||||
double y;
|
||||
|
||||
if ( fabs(p0.x() - p1.x()) > FG_EPSILON ) {
|
||||
if ( fabs(p0.x() - p1.x()) > SG_EPSILON ) {
|
||||
y = p1.y() + (x - p1.x()) * (p0.y() - p1.y()) / (p0.x() - p1.x());
|
||||
} else {
|
||||
return false;
|
||||
|
@ -994,8 +994,8 @@ FGPolygon remove_dups( const FGPolygon &poly ) {
|
|||
}
|
||||
|
||||
|
||||
// static const double tgAirportEpsilon = FG_EPSILON / 10.0;
|
||||
static const double tgAirportEpsilon = FG_EPSILON;
|
||||
// static const double tgAirportEpsilon = SG_EPSILON / 10.0;
|
||||
static const double tgAirportEpsilon = SG_EPSILON;
|
||||
|
||||
|
||||
// Find a point in the given node list that lies between start and
|
||||
|
@ -1041,8 +1041,8 @@ bool find_intermediate_node( const Point3D& start, const Point3D& end,
|
|||
// cout << i << endl;
|
||||
Point3D current = nodes[i];
|
||||
|
||||
if ( (current.x() > (p_min.x() + FG_EPSILON))
|
||||
&& (current.x() < (p_max.x() - FG_EPSILON)) ) {
|
||||
if ( (current.x() > (p_min.x() + SG_EPSILON))
|
||||
&& (current.x() < (p_max.x() - SG_EPSILON)) ) {
|
||||
|
||||
// printf( "found a potential candidate %.7f %.7f %.7f\n",
|
||||
// current.x(), current.y(), current.z() );
|
||||
|
@ -1089,8 +1089,8 @@ bool find_intermediate_node( const Point3D& start, const Point3D& end,
|
|||
for ( int i = 0; i < (int)nodes.size(); ++i ) {
|
||||
Point3D current = nodes[i];
|
||||
|
||||
if ( (current.y() > (p_min.y() + FG_EPSILON))
|
||||
&& (current.y() < (p_max.y() - FG_EPSILON)) ) {
|
||||
if ( (current.y() > (p_min.y() + SG_EPSILON))
|
||||
&& (current.y() < (p_max.y() - SG_EPSILON)) ) {
|
||||
|
||||
// printf( "found a potential candidate %.7f %.7f %.7f\n",
|
||||
// current.x(), current.y(), current.z() );
|
||||
|
|
|
@ -123,8 +123,8 @@ void FGTriSegments::unique_divide_and_add( const point_list& nodes,
|
|||
last = nodes.end();
|
||||
counter = 0;
|
||||
for ( ; current != last; ++current ) {
|
||||
if ( (current->x() > (p0.x() + FG_EPSILON))
|
||||
&& (current->x() < (p1.x() - FG_EPSILON)) ) {
|
||||
if ( (current->x() > (p0.x() + SG_EPSILON))
|
||||
&& (current->x() < (p1.x() - SG_EPSILON)) ) {
|
||||
|
||||
// if ( temp ) {
|
||||
// cout << counter << endl;
|
||||
|
@ -172,8 +172,8 @@ void FGTriSegments::unique_divide_and_add( const point_list& nodes,
|
|||
last = nodes.end();
|
||||
counter = 0;
|
||||
for ( ; current != last; ++current ) {
|
||||
if ( (current->y() > (p0.y() + FG_EPSILON))
|
||||
&& (current->y() < (p1.y() - FG_EPSILON)) ) {
|
||||
if ( (current->y() > (p0.y() + SG_EPSILON))
|
||||
&& (current->y() < (p1.y() - SG_EPSILON)) ) {
|
||||
|
||||
x_err = fabs(current->x() - (m1 * current->y() + b1));
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ double FGPolygon::minangle_contour( const int contour ) {
|
|||
int p1_index, p2_index, p3_index;
|
||||
point2d p1, p2, p3;
|
||||
double angle;
|
||||
double min_angle = 2.0 * FG_PI;
|
||||
double min_angle = 2.0 * SG_PI;
|
||||
|
||||
for ( int i = 0; i < size; ++i ) {
|
||||
p1_index = i - 1;
|
||||
|
|
|
@ -110,8 +110,8 @@ bool FGMerger::load_polys(const string& path, FGPolyList& subject) {
|
|||
in >> lastx;
|
||||
in >> lasty;
|
||||
|
||||
if ( (fabs(startx - lastx) < FG_EPSILON)
|
||||
&& (fabs(starty - lasty) < FG_EPSILON) ) {
|
||||
if ( (fabs(startx - lastx) < SG_EPSILON)
|
||||
&& (fabs(starty - lasty) < SG_EPSILON) ) {
|
||||
// last point same as first, discard
|
||||
} else {
|
||||
p = Point3D( lastx, lasty, 0.0 );
|
||||
|
|
Loading…
Add table
Reference in a new issue