1
0
Fork 0

First pass at new runway layout.

This commit is contained in:
curt 2002-10-25 14:46:09 +00:00
parent 7368effd9e
commit 8817ba7454
5 changed files with 159 additions and 23 deletions

View file

@ -177,11 +177,18 @@ point_list calc_elevations( const string& root, const point_list& geod_nodes,
int i, j;
FGArray array;
// just bail if no work to do
if ( ! result.size() ) {
return result;
}
// set all elevations to -9999
for ( i = 0; i < (int)result.size(); ++i ) {
result[i].setz( -9999.0 );
}
cout << "result.size() = " << result.size() << endl;
while ( !done ) {
// find first node with -9999 elevation
i = 0;
@ -234,7 +241,6 @@ point_list calc_elevations( const string& root, const point_list& geod_nodes,
}
}
return result;
}

View file

@ -31,18 +31,24 @@
void gen_number_block( const FGRunway& rwy_info,
const string& material,
FGPolygon poly, double heading, int num,
double start_pct, double end_pct,
superpoly_list *rwy_polys,
texparams_list *texparams,
FGPolygon *accum )
const string& material,
FGPolygon poly, double heading, int num,
double start_pct, double end_pct,
superpoly_list *rwy_polys,
texparams_list *texparams,
FGPolygon *accum )
{
char tex1[32]; tex1[0] = '\0';
char tex2[32]; tex2[0] = '\0';
SG_LOG(SG_GENERAL, SG_DEBUG, "Runway num = " << num);
if ( num == 0 ) {
SG_LOG( SG_GENERAL, SG_ALERT,
"Ack! Someone passed in a runway number of '0'" );
exit(-1);
}
if ( num == 11 ) {
sprintf( tex1, "11" );
} else if ( num < 10 ) {
@ -191,8 +197,15 @@ void gen_runway_section( const FGRunway& rwy_info,
}
}
// Clip the new polygon against what ever has already been created.
FGPolygon clipped = polygon_diff( section, *accum );
// Split long edges to create an object that can better flow with
// the surface terrain
FGPolygon split = split_long_edges( clipped, 400.0 );
// Create the final output and push on to the runway super_polygon
// list
FGSuperPoly sp;
sp.erase();
sp.set_poly( split );
@ -201,11 +214,24 @@ void gen_runway_section( const FGRunway& rwy_info,
SG_LOG(SG_GENERAL, SG_DEBUG, "section = " << clipped.contours());
*accum = polygon_union( section, *accum );
double len = rwy_info.length / 2.0;
// Store away what we need to know for texture coordinate
// calculation. (CLO 10/20/02: why can't we calculate texture
// coordinates here? Oh, becuase later we need to massage the
// polygons to avoid "T" intersections and clean up other
// potential artifacts and we may add or remove points and need to
// do new texture coordinate calcs later.
// we add 2' to the length for texture overlap. This puts the
// lines on the texture back to the edge of the runway where they
// belong.
double len = rwy_info.length / 2.0 + 2;
double start_len = len - ( len * startl_pct );
double end_len = len - ( len * endl_pct );
double wid = rwy_info.width;
// we add 2' to both sides of the runway (4' total) for texture
// overlap. This puts the lines on the texture back to the edge
// of the runway where they belong.
double wid = rwy_info.width + 4;
double start_wid = -wid / 2.0 + wid * startw_pct;
double end_wid = -wid / 2.0 + wid * endw_pct;

View file

@ -83,7 +83,10 @@ void gen_non_precision_rwy( const FGRunway& rwy_info,
FGSuperPoly sp;
FGTexParams tp;
double length = rwy_info.length / 2.0;
// we add 2' to the length for texture overlap. This puts the
// lines on the texture back to the edge of the runway where they
// belong.
double length = rwy_info.length / 2.0 + 2.0;
if ( length < 1150 ) {
SG_LOG(SG_GENERAL, SG_ALERT,
"This runway is not long enough for non-precision markings!");
@ -96,7 +99,7 @@ void gen_non_precision_rwy( const FGRunway& rwy_info,
// Threshold
//
end_pct = start_pct + ( 190.0 / length );
end_pct = start_pct + ( 192.0 / length );
gen_runway_section( rwy_info, runway_a,
start_pct, end_pct,
0.0, 1.0,
@ -248,9 +251,16 @@ void gen_non_precision_rwy( const FGRunway& rwy_info,
// The rest ...
//
// fit the 'rest' texture in as many times as will go evenly into
// the remaining distance so we don't end up with a super short
// section at the end.
double ideal_rest_inc = ( 200.0 / length );
int divs = (int)((1.0 - end_pct) / ideal_rest_inc) + 1;
double rest_inc = (1.0 - end_pct) / divs;
while ( end_pct < 1.0 ) {
start_pct = end_pct;
end_pct = start_pct + ( 400.0 / length );
end_pct = start_pct + rest_inc;
gen_runway_section( rwy_info, runway_a,
start_pct, end_pct,

View file

@ -85,7 +85,10 @@ void gen_precision_rwy( const FGRunway& rwy_info,
FGSuperPoly sp;
FGTexParams tp;
double length = rwy_info.length / 2.0;
// we add 2' to the length for texture overlap. This puts the
// lines on the texture back to the edge of the runway where they
// belong.
double length = rwy_info.length / 2.0 + 2.0;
if ( length < 3075 ) {
SG_LOG(SG_GENERAL, SG_ALERT,
"This runway is not long enough for precision markings!");
@ -98,7 +101,7 @@ void gen_precision_rwy( const FGRunway& rwy_info,
// Threshold
//
end_pct = start_pct + ( 190.0 / length );
end_pct = start_pct + ( 192.0 / length );
gen_runway_section( rwy_info, runway_a,
start_pct, end_pct,
0.0, 1.0,
@ -189,7 +192,7 @@ void gen_precision_rwy( const FGRunway& rwy_info,
//
start_pct = end_pct;
end_pct = start_pct + ( 650 / length );
end_pct = start_pct + ( 380 / length );
gen_runway_section( rwy_info, runway_a,
start_pct, end_pct,
0.0, 1.0,
@ -204,12 +207,29 @@ void gen_precision_rwy( const FGRunway& rwy_info,
material, "tz_three",
rwy_polys, texparams, accum );
// add a section of center stripe
start_pct = end_pct;
end_pct = start_pct + ( 200 / length );
gen_runway_section( rwy_info, runway_a,
start_pct, end_pct,
0.0, 1.0,
rwy_info.heading,
material, "rest",
rwy_polys, texparams, accum );
gen_runway_section( rwy_info, runway_b,
start_pct, end_pct,
0.0, 1.0,
rwy_info.heading + 180.0,
material, "rest",
rwy_polys, texparams, accum );
//
// Aiming point
//
start_pct = end_pct;
end_pct = start_pct + ( 500 / length );
end_pct = start_pct + ( 400 / length );
gen_runway_section( rwy_info, runway_a,
start_pct, end_pct,
0.0, 1.0,
@ -233,7 +253,7 @@ void gen_precision_rwy( const FGRunway& rwy_info,
}
start_pct = end_pct;
end_pct = start_pct + ( 500 / length );
end_pct = start_pct + ( 400 / length );
gen_runway_section( rwy_info, runway_a,
start_pct, end_pct,
0.0, 1.0,
@ -248,6 +268,23 @@ void gen_precision_rwy( const FGRunway& rwy_info,
material, "tz_two_a",
rwy_polys, texparams, accum );
// add a section of center stripe
start_pct = end_pct;
end_pct = start_pct + ( 200 / length );
gen_runway_section( rwy_info, runway_a,
start_pct, end_pct,
0.0, 1.0,
rwy_info.heading,
material, "rest",
rwy_polys, texparams, accum );
gen_runway_section( rwy_info, runway_b,
start_pct, end_pct,
0.0, 1.0,
rwy_info.heading + 180.0,
material, "rest",
rwy_polys, texparams, accum );
//
// Touch down zone x2 (second)
//
@ -257,7 +294,7 @@ void gen_precision_rwy( const FGRunway& rwy_info,
}
start_pct = end_pct;
end_pct = start_pct + ( 500 / length );
end_pct = start_pct + ( 200 / length );
gen_runway_section( rwy_info, runway_a,
start_pct, end_pct,
0.0, 1.0,
@ -272,6 +309,23 @@ void gen_precision_rwy( const FGRunway& rwy_info,
material, "tz_two_b",
rwy_polys, texparams, accum );
// add a section of center stripe
start_pct = end_pct;
end_pct = start_pct + ( 200 / length );
gen_runway_section( rwy_info, runway_a,
start_pct, end_pct,
0.0, 1.0,
rwy_info.heading,
material, "rest",
rwy_polys, texparams, accum );
gen_runway_section( rwy_info, runway_b,
start_pct, end_pct,
0.0, 1.0,
rwy_info.heading + 180.0,
material, "rest",
rwy_polys, texparams, accum );
//
// Touch down zone x1 (first)
//
@ -281,7 +335,7 @@ void gen_precision_rwy( const FGRunway& rwy_info,
}
start_pct = end_pct;
end_pct = start_pct + ( 500 / length );
end_pct = start_pct + ( 400 / length );
gen_runway_section( rwy_info, runway_a,
start_pct, end_pct,
0.0, 1.0,
@ -296,6 +350,23 @@ void gen_precision_rwy( const FGRunway& rwy_info,
material, "tz_one_a",
rwy_polys, texparams, accum );
// add a section of center stripe
start_pct = end_pct;
end_pct = start_pct + ( 200 / length );
gen_runway_section( rwy_info, runway_a,
start_pct, end_pct,
0.0, 1.0,
rwy_info.heading,
material, "rest",
rwy_polys, texparams, accum );
gen_runway_section( rwy_info, runway_b,
start_pct, end_pct,
0.0, 1.0,
rwy_info.heading + 180.0,
material, "rest",
rwy_polys, texparams, accum );
//
// Touch down zone x1 (second)
//
@ -305,7 +376,7 @@ void gen_precision_rwy( const FGRunway& rwy_info,
}
start_pct = end_pct;
end_pct = start_pct + ( 500 / length );
end_pct = start_pct + ( 200 / length );
gen_runway_section( rwy_info, runway_a,
start_pct, end_pct,
0.0, 1.0,
@ -324,9 +395,16 @@ void gen_precision_rwy( const FGRunway& rwy_info,
// The rest ...
//
// fit the 'rest' texture in as many times as will go evenly into
// the remaining distance so we don't end up with a super short
// section at the end.
double ideal_rest_inc = ( 200.0 / length );
int divs = (int)((1.0 - end_pct) / ideal_rest_inc) + 1;
double rest_inc = (1.0 - end_pct) / divs;
while ( end_pct < 1.0 ) {
start_pct = end_pct;
end_pct = start_pct + ( 400.0 / length );
end_pct = start_pct + rest_inc;
gen_runway_section( rwy_info, runway_a,
start_pct, end_pct,

View file

@ -84,7 +84,10 @@ void gen_visual_rwy( const FGRunway& rwy_info,
FGSuperPoly sp;
FGTexParams tp;
double length = rwy_info.length / 2.0;
// we add 2' to the length for texture overlap. This puts the
// lines on the texture back to the edge of the runway where they
// belong.
double length = rwy_info.length / 2.0 + 2.0;
if ( length < 1150 ) {
SG_LOG(SG_GENERAL, SG_ALERT,
"This runway is not long enough for visual markings!");
@ -94,6 +97,12 @@ void gen_visual_rwy( const FGRunway& rwy_info,
double end_pct = 0;
//
// Threshold
//
// we to put a mini threshold in here some how if we can....
//
// Runway designation letter
//
@ -240,9 +249,16 @@ void gen_visual_rwy( const FGRunway& rwy_info,
// The rest ...
//
// fit the 'rest' texture in as many times as will go evenly into
// the remaining distance so we don't end up with a super short
// section at the end.
double ideal_rest_inc = ( 200.0 / length );
int divs = (int)((1.0 - end_pct) / ideal_rest_inc) + 1;
double rest_inc = (1.0 - end_pct) / divs;
while ( end_pct < 1.0 ) {
start_pct = end_pct;
end_pct = start_pct + ( 400.0 / length );
end_pct = start_pct + rest_inc;
gen_runway_section( rwy_info, runway_a,
start_pct, end_pct,