Fixed a bug that occured when an airport was located on a tile corner. The
first tile to build that corner gets to define the shared point, but since it was clipped out by the airport hole, the value defaulted to randomness. This was then propogated on to adjacent tiles. I now calculate the corner value in advance so the code is not dependent on finding the corner in the resulting point set.
This commit is contained in:
parent
231af62823
commit
97a83fb03c
2 changed files with 11 additions and 5 deletions
|
@ -109,6 +109,7 @@ bool FGClipper::load_polys(const string& path) {
|
|||
in >> startx;
|
||||
in >> starty;
|
||||
p = Point3D(startx, starty, 0.0);
|
||||
cout << "poly pt = " << p << endl;
|
||||
poly.add_node( i, p );
|
||||
FG_LOG( FG_CLIPPER, FG_BULK, "0 = "
|
||||
<< startx << ", " << starty );
|
||||
|
@ -117,8 +118,8 @@ bool FGClipper::load_polys(const string& path) {
|
|||
in >> x;
|
||||
in >> y;
|
||||
p = Point3D( x, y, 0.0 );
|
||||
cout << "poly pt = " << p << endl;
|
||||
poly.add_node( i, p );
|
||||
FG_LOG( FG_CLIPPER, FG_BULK, j << " = " << x << ", " << y );
|
||||
}
|
||||
|
||||
in >> lastx;
|
||||
|
@ -129,9 +130,8 @@ bool FGClipper::load_polys(const string& path) {
|
|||
// last point same as first, discard
|
||||
} else {
|
||||
p = Point3D( lastx, lasty, 0.0 );
|
||||
cout << "poly pt = " << p << endl;
|
||||
poly.add_node( i, p );
|
||||
FG_LOG( FG_CLIPPER, FG_BULK, count - 1 << " = "
|
||||
<< lastx << ", " << lasty );
|
||||
}
|
||||
|
||||
// gpc_add_contour( poly, &v_list, hole_flag );
|
||||
|
|
|
@ -59,7 +59,7 @@ void FGMatch::scan_share_file( const string& dir, const FGBucket& b,
|
|||
return;
|
||||
}
|
||||
|
||||
// cout << "reading shared data from " << file << endl;
|
||||
cout << "reading shared data from " << file << endl;
|
||||
|
||||
string target;
|
||||
if ( search == SW_Corner ) {
|
||||
|
@ -228,7 +228,7 @@ void FGMatch::load_neighbor_shared( FGConstruct& c ) {
|
|||
if ( se_flag ) { cout << " se corner = " << se_node << endl; }
|
||||
if ( ne_flag ) { cout << " ne corner = " << ne_node << endl; }
|
||||
if ( nw_flag ) { cout << " nw corner = " << nw_node << endl; }
|
||||
if ( north_flag ) {
|
||||
if ( north_flag ) {
|
||||
cout << " north nodes = " << north_nodes.size() << endl;
|
||||
for ( int i = 0; i < (int)north_nodes.size(); ++i ) {
|
||||
cout << " " << north_nodes[i] << endl;
|
||||
|
@ -273,6 +273,12 @@ void FGMatch::split_tile( FGConstruct& c ) {
|
|||
max.x = b.get_center_lon() + 0.5 * b.get_width();
|
||||
max.y = b.get_center_lat() + 0.5 * b.get_height();
|
||||
|
||||
// defaults "just in case"
|
||||
sw_node = Point3D( min.x, min.y, 0.0 );
|
||||
se_node = Point3D( max.x, min.y, 0.0 );
|
||||
nw_node = Point3D( min.x, max.y, 0.0 );
|
||||
ne_node = Point3D( max.x, max.y, 0.0 );
|
||||
|
||||
// separate nodes and normals into components
|
||||
|
||||
body_nodes.clear();
|
||||
|
|
Loading…
Add table
Reference in a new issue