1
0
Fork 0

- Add support for displaced thresholds on runways with nonprecision and visual

markings.
- Fix a couple very small alignment/sizing problems.
- Use a different texture (similar to rest) before aim points on nonprecision
  runways.  This will potentially make things easier if we want to add
  skid marks to the textures.
- Fix a couple bugs (el stupido) in precision marking generation.
This commit is contained in:
curt 2003-09-05 20:13:29 +00:00
parent 2538ac773f
commit ff685ced13
3 changed files with 438 additions and 195 deletions

View file

@ -96,24 +96,133 @@ void gen_non_precision_rwy( const TGRunway& rwy_info,
"This runway is not long enough for non-precision markings!"); "This runway is not long enough for non-precision markings!");
} }
double start_pct = 0; double start1_pct = 0.0;
double end_pct = 0; double start2_pct = 0.0;
double end1_pct = 0.0;
double end2_pct = 0.0;
//
// Displaced threshold if it exists
//
if ( rwy_info.disp_thresh1 > 0.0 ) {
SG_LOG( SG_GENERAL, SG_INFO, "Forward displaced threshold = "
<< rwy_info.disp_thresh1 );
// reserve 90' for final arrows
double thresh = rwy_info.disp_thresh1 - 90.0;
// number of full center arrows
int count = (int)(thresh / 200.0);
// length of starting partial arrow
double part_len = thresh - ( count * 200.0 );
double tex_pct = (200.0 - part_len) / 200.0;
// starting (possibly partial chunk)
start2_pct = end2_pct;
end2_pct = start2_pct + ( part_len / length );
gen_runway_section( rwy_info, runway_b,
start2_pct, end2_pct,
0.0, 1.0,
0.0, 1.0, tex_pct, 1.0,
rwy_info.heading + 180.0,
material, "dspl_thresh",
rwy_polys, texparams, accum );
// main chunks
for ( i = 0; i < count; ++i ) {
start2_pct = end2_pct;
end2_pct = start2_pct + ( 200.0 / length );
gen_runway_section( rwy_info, runway_b,
start2_pct, end2_pct,
0.0, 1.0,
0.0, 1.0, 0.0, 1.0,
rwy_info.heading + 180.0,
material, "dspl_thresh",
rwy_polys, texparams, accum );
}
// final arrows
start2_pct = end2_pct;
end2_pct = start2_pct + ( 90.0 / length );
gen_runway_section( rwy_info, runway_b,
start2_pct, end2_pct,
0.0, 1.0,
0.0, 1.0, 0.0, 1.0,
rwy_info.heading + 180.0,
material, "dspl_arrows",
rwy_polys, texparams, accum );
}
if ( rwy_info.disp_thresh2 > 0.0 ) {
SG_LOG( SG_GENERAL, SG_INFO, "Reverse displaced threshold = "
<< rwy_info.disp_thresh2 );
// reserve 90' for final arrows
double thresh = rwy_info.disp_thresh2 - 90.0;
// number of full center arrows
int count = (int)(thresh / 200.0);
// length of starting partial arrow
double part_len = thresh - ( count * 200.0 );
double tex_pct = (200.0 - part_len) / 200.0;
// starting (possibly partial chunk)
start1_pct = end1_pct;
end1_pct = start1_pct + ( part_len / length );
gen_runway_section( rwy_info, runway_a,
start1_pct, end1_pct,
0.0, 1.0,
0.0, 1.0, tex_pct, 1.0,
rwy_info.heading,
material, "dspl_thresh",
rwy_polys, texparams, accum );
// main chunks
for ( i = 0; i < count; ++i ) {
start1_pct = end1_pct;
end1_pct = start1_pct + ( 200.0 / length );
gen_runway_section( rwy_info, runway_a,
start1_pct, end1_pct,
0.0, 1.0,
0.0, 1.0, 0.0, 1.0,
rwy_info.heading,
material, "dspl_thresh",
rwy_polys, texparams, accum );
}
// final arrows
start1_pct = end1_pct;
end1_pct = start1_pct + ( 90.0 / length );
gen_runway_section( rwy_info, runway_a,
start1_pct, end1_pct,
0.0, 1.0,
0.0, 1.0, 0.0, 1.0,
rwy_info.heading,
material, "dspl_arrows",
rwy_polys, texparams, accum );
}
// //
// Threshold // Threshold
// //
end_pct = start_pct + ( 192.0 / length ); start1_pct = end1_pct;
end1_pct = start1_pct + ( 202.0 / length );
gen_runway_section( rwy_info, runway_a, gen_runway_section( rwy_info, runway_a,
start_pct, end_pct, start1_pct, end1_pct,
0.0, 1.0, 0.0, 1.0,
0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0,
rwy_info.heading, rwy_info.heading,
material, "threshold", material, "threshold",
rwy_polys, texparams, accum ); rwy_polys, texparams, accum );
start2_pct = end2_pct;
end2_pct = start2_pct + ( 202.0 / length );
gen_runway_section( rwy_info, runway_b, gen_runway_section( rwy_info, runway_b,
start_pct, end_pct, start2_pct, end2_pct,
0.0, 1.0, 0.0, 1.0,
0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0,
rwy_info.heading + 180.0, rwy_info.heading + 180.0,
@ -145,18 +254,20 @@ void gen_non_precision_rwy( const TGRunway& rwy_info,
SG_LOG(SG_GENERAL, SG_DEBUG, "Runway designation letter = " << letter); SG_LOG(SG_GENERAL, SG_DEBUG, "Runway designation letter = " << letter);
if ( !letter.empty() ) { if ( !letter.empty() ) {
start_pct = end_pct; start1_pct = end1_pct;
end_pct = start_pct + ( 90.0 / length ); end1_pct = start1_pct + ( 90.0 / length );
gen_runway_section( rwy_info, runway_a, gen_runway_section( rwy_info, runway_a,
start_pct, end_pct, start1_pct, end1_pct,
0.0, 1.0, 0.0, 1.0,
0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0,
rwy_info.heading, rwy_info.heading,
material, rev_letter, material, rev_letter,
rwy_polys, texparams, accum ); rwy_polys, texparams, accum );
start2_pct = end2_pct;
end2_pct = start2_pct + ( 90.0 / length );
gen_runway_section( rwy_info, runway_b, gen_runway_section( rwy_info, runway_b,
start_pct, end_pct, start2_pct, end2_pct,
0.0, 1.0, 0.0, 1.0,
0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0,
rwy_info.heading + 180.0, rwy_info.heading + 180.0,
@ -168,9 +279,6 @@ void gen_non_precision_rwy( const TGRunway& rwy_info,
// Runway designation number(s) // Runway designation number(s)
// //
start_pct = end_pct;
end_pct = start_pct + ( 100.0 / length );
len = rwy_info.rwy_no.length(); len = rwy_info.rwy_no.length();
string snum = rwy_info.rwy_no; string snum = rwy_info.rwy_no;
for ( i = 0; i < len; ++i ) { for ( i = 0; i < len; ++i ) {
@ -185,78 +293,72 @@ void gen_non_precision_rwy( const TGRunway& rwy_info,
num += 36; num += 36;
} }
start2_pct = end2_pct;
end2_pct = start2_pct + ( 80.0 / length );
gen_number_block( rwy_info, material, runway_b, rwy_info.heading + 180.0, gen_number_block( rwy_info, material, runway_b, rwy_info.heading + 180.0,
num, start_pct, end_pct, rwy_polys, texparams, accum ); num, start2_pct, end2_pct, rwy_polys, texparams, accum );
num += 18; num += 18;
while ( num > 36 ) { while ( num > 36 ) {
num -= 36; num -= 36;
} }
start1_pct = end1_pct;
end1_pct = start1_pct + ( 80.0 / length );
gen_number_block( rwy_info, material, runway_a, rwy_info.heading, gen_number_block( rwy_info, material, runway_a, rwy_info.heading,
num, start_pct, end_pct, rwy_polys, texparams, accum ); num, start1_pct, end1_pct, rwy_polys, texparams, accum );
if ( false ) { if ( true ) {
// //
// Intermediate area before aiming point ... // Intermediate area before aiming point ...
// //
start_pct = end_pct; for ( i = 0; i < 3; ++i ) {
end_pct = start_pct + ( 360.0 / length ); start1_pct = end1_pct;
gen_runway_section( rwy_info, runway_a, end1_pct = start1_pct + ( 200 / length );
start_pct, end_pct, gen_runway_section( rwy_info, runway_a,
0.0, 1.0, start1_pct, end1_pct,
0.0, 1.0, 0.0, 1.0, 0.0, 1.0,
rwy_info.heading, 0.0, 1.0, 0.0, 1.0,
material, "rest", rwy_info.heading,
rwy_polys, texparams, accum ); material, "centerline",
rwy_polys, texparams, accum );
gen_runway_section( rwy_info, runway_b, start2_pct = end2_pct;
start_pct, end_pct, end2_pct = start2_pct + ( 200 / length );
0.0, 1.0, gen_runway_section( rwy_info, runway_b,
0.0, 1.0, 0.0, 1.0, start2_pct, end2_pct,
rwy_info.heading + 180.0, 0.0, 1.0,
material, "rest", 0.0, 1.0, 0.0, 1.0,
rwy_polys, texparams, accum ); rwy_info.heading + 180.0,
material, "centerline",
start_pct = end_pct; rwy_polys, texparams, accum );
end_pct = start_pct + ( 360.0 / length ); }
gen_runway_section( rwy_info, runway_a,
start_pct, end_pct,
0.0, 1.0,
0.0, 1.0, 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,
0.0, 1.0, 0.0, 1.0,
material, "rest",
rwy_polys, texparams, accum );
// //
// Aiming point // Aiming point
// //
if ( end_pct >= 1.0 ) { if ( end1_pct >= 1.0 ) {
return; return;
} }
start1_pct = end1_pct;
start_pct = end_pct; end1_pct = start1_pct + ( 400 / length );
end_pct = start_pct + ( 500 / length );
gen_runway_section( rwy_info, runway_a, gen_runway_section( rwy_info, runway_a,
start_pct, end_pct, start1_pct, end1_pct,
0.0, 1.0, 0.0, 1.0,
0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0,
rwy_info.heading, rwy_info.heading,
material, "aim", material, "aim",
rwy_polys, texparams, accum ); rwy_polys, texparams, accum );
if ( end2_pct >= 1.0 ) {
return;
}
start2_pct = end2_pct;
end2_pct = start2_pct + ( 400 / length );
gen_runway_section( rwy_info, runway_b, gen_runway_section( rwy_info, runway_b,
start_pct, end_pct, start2_pct, end2_pct,
0.0, 1.0, 0.0, 1.0,
0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0,
rwy_info.heading + 180.0, rwy_info.heading + 180.0,
@ -272,23 +374,32 @@ void gen_non_precision_rwy( const TGRunway& rwy_info,
// the remaining distance so we don't end up with a super short // the remaining distance so we don't end up with a super short
// section at the end. // section at the end.
double ideal_rest_inc = ( 200.0 / length ); double ideal_rest_inc = ( 200.0 / length );
int divs = (int)((1.0 - end_pct) / ideal_rest_inc) + 1; int divs = (int)((1.0 - end1_pct) / ideal_rest_inc) + 1;
double rest_inc = (1.0 - end_pct) / divs; double rest1_inc = (1.0 - end1_pct) / divs;
while ( end_pct < 1.0 ) { while ( end1_pct < 1.0 ) {
start_pct = end_pct; start1_pct = end1_pct;
end_pct = start_pct + rest_inc; end1_pct = start1_pct + rest1_inc;
gen_runway_section( rwy_info, runway_a, gen_runway_section( rwy_info, runway_a,
start_pct, end_pct, start1_pct, end1_pct,
0.0, 1.0, 0.0, 1.0,
0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0,
rwy_info.heading, rwy_info.heading,
material, "rest", material, "rest",
rwy_polys, texparams, accum ); rwy_polys, texparams, accum );
}
ideal_rest_inc = ( 200.0 / length );
divs = (int)((1.0 - end2_pct) / ideal_rest_inc) + 1;
double rest2_inc = (1.0 - end2_pct) / divs;
while ( end2_pct < 1.0 ) {
start2_pct = end2_pct;
end2_pct = start2_pct + rest2_inc;
gen_runway_section( rwy_info, runway_b, gen_runway_section( rwy_info, runway_b,
start_pct, end_pct, start2_pct, end2_pct,
0.0, 1.0, 0.0, 1.0,
0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0,
rwy_info.heading + 180.0, rwy_info.heading + 180.0,

View file

@ -41,6 +41,7 @@ void gen_precision_rwy( const TGRunway& rwy_info,
texparams_list *texparams, texparams_list *texparams,
TGPolygon *accum ) TGPolygon *accum )
{ {
SG_LOG( SG_GENERAL, SG_INFO, "Building runway = " << rwy_info.rwy_no );
// //
// Generate the basic runway outlines // Generate the basic runway outlines
@ -52,7 +53,7 @@ void gen_precision_rwy( const TGRunway& rwy_info,
2 * SG_FEET_TO_METER, 2 * SG_FEET_TO_METER,
2 * SG_FEET_TO_METER ); 2 * SG_FEET_TO_METER );
// runway half "a" // runway half "a" (actually the reverse half)
TGPolygon runway_a; TGPolygon runway_a;
runway_a.erase(); runway_a.erase();
runway_a.add_node( 0, runway.get_pt(0, 0) ); runway_a.add_node( 0, runway.get_pt(0, 0) );
@ -61,7 +62,7 @@ void gen_precision_rwy( const TGRunway& rwy_info,
runway_a.add_node( 0, runway.get_pt(0, 5) ); runway_a.add_node( 0, runway.get_pt(0, 5) );
// runway half "b" // runway half "b" (actually the forward half)
TGPolygon runway_b; TGPolygon runway_b;
runway_b.erase(); runway_b.erase();
runway_b.add_node( 0, runway.get_pt(0, 3) ); runway_b.add_node( 0, runway.get_pt(0, 3) );
@ -109,55 +110,11 @@ void gen_precision_rwy( const TGRunway& rwy_info,
// //
if ( rwy_info.disp_thresh1 > 0.0 ) { if ( rwy_info.disp_thresh1 > 0.0 ) {
// reserve 100' for final arrows SG_LOG( SG_GENERAL, SG_INFO, "Forward displaced threshold = "
double thresh = rwy_info.disp_thresh1 - 100.0; << rwy_info.disp_thresh1 );
// number of full center arrows // reserve 90' for final arrows
int count = (int)(thresh / 200.0); double thresh = rwy_info.disp_thresh1 - 90.0;
// length of starting partial arrow
double part_len = thresh - ( count * 200.0 );
double tex_pct = (200.0 - part_len) / 200.0;
// starting (possibly partial chunk)
start1_pct = end1_pct;
end1_pct = start1_pct + ( part_len / length );
gen_runway_section( rwy_info, runway_a,
start1_pct, end1_pct,
0.0, 1.0,
0.0, 1.0, tex_pct, 1.0,
rwy_info.heading,
material, "dspl_thresh",
rwy_polys, texparams, accum );
// main chunks
for ( i = 0; i < count; ++i ) {
start1_pct = end1_pct;
end1_pct = start1_pct + ( 200.0 / length );
gen_runway_section( rwy_info, runway_a,
start1_pct, end1_pct,
0.0, 1.0,
0.0, 1.0, 0.0, 1.0,
rwy_info.heading,
material, "dspl_thresh",
rwy_polys, texparams, accum );
}
// final arrows
start1_pct = end1_pct;
end1_pct = start1_pct + ( 100.0 / length );
gen_runway_section( rwy_info, runway_a,
start1_pct, end1_pct,
0.0, 1.0,
0.0, 1.0, 0.0, 1.0,
rwy_info.heading,
material, "dspl_arrows",
rwy_polys, texparams, accum );
}
if ( rwy_info.disp_thresh2 > 0.0 ) {
// reserve 100' for final arrows
double thresh = rwy_info.disp_thresh2 - 100.0;
// number of full center arrows // number of full center arrows
int count = (int)(thresh / 200.0); int count = (int)(thresh / 200.0);
@ -192,7 +149,7 @@ void gen_precision_rwy( const TGRunway& rwy_info,
// final arrows // final arrows
start2_pct = end2_pct; start2_pct = end2_pct;
end2_pct = start2_pct + ( 100.0 / length ); end2_pct = start2_pct + ( 90.0 / length );
gen_runway_section( rwy_info, runway_b, gen_runway_section( rwy_info, runway_b,
start2_pct, end2_pct, start2_pct, end2_pct,
0.0, 1.0, 0.0, 1.0,
@ -202,12 +159,62 @@ void gen_precision_rwy( const TGRunway& rwy_info,
rwy_polys, texparams, accum ); rwy_polys, texparams, accum );
} }
if ( rwy_info.disp_thresh2 > 0.0 ) {
SG_LOG( SG_GENERAL, SG_INFO, "Reverse displaced threshold = "
<< rwy_info.disp_thresh2 );
// reserve 90' for final arrows
double thresh = rwy_info.disp_thresh2 - 90.0;
// number of full center arrows
int count = (int)(thresh / 200.0);
// length of starting partial arrow
double part_len = thresh - ( count * 200.0 );
double tex_pct = (200.0 - part_len) / 200.0;
// starting (possibly partial chunk)
start1_pct = end1_pct;
end1_pct = start1_pct + ( part_len / length );
gen_runway_section( rwy_info, runway_a,
start1_pct, end1_pct,
0.0, 1.0,
0.0, 1.0, tex_pct, 1.0,
rwy_info.heading,
material, "dspl_thresh",
rwy_polys, texparams, accum );
// main chunks
for ( i = 0; i < count; ++i ) {
start1_pct = end1_pct;
end1_pct = start1_pct + ( 200.0 / length );
gen_runway_section( rwy_info, runway_a,
start1_pct, end1_pct,
0.0, 1.0,
0.0, 1.0, 0.0, 1.0,
rwy_info.heading,
material, "dspl_thresh",
rwy_polys, texparams, accum );
}
// final arrows
start1_pct = end1_pct;
end1_pct = start1_pct + ( 90.0 / length );
gen_runway_section( rwy_info, runway_a,
start1_pct, end1_pct,
0.0, 1.0,
0.0, 1.0, 0.0, 1.0,
rwy_info.heading,
material, "dspl_arrows",
rwy_polys, texparams, accum );
}
// //
// Threshold // Threshold
// //
start1_pct = end1_pct; start1_pct = end1_pct;
end1_pct = start1_pct + ( 192.0 / length ); end1_pct = start1_pct + ( 202.0 / length );
gen_runway_section( rwy_info, runway_a, gen_runway_section( rwy_info, runway_a,
start1_pct, end1_pct, start1_pct, end1_pct,
0.0, 1.0, 0.0, 1.0,
@ -217,7 +224,7 @@ void gen_precision_rwy( const TGRunway& rwy_info,
rwy_polys, texparams, accum ); rwy_polys, texparams, accum );
start2_pct = end2_pct; start2_pct = end2_pct;
end2_pct = start2_pct + ( 192.0 / length ); end2_pct = start2_pct + ( 202.0 / length );
gen_runway_section( rwy_info, runway_b, gen_runway_section( rwy_info, runway_b,
start2_pct, end2_pct, start2_pct, end2_pct,
0.0, 1.0, 0.0, 1.0,
@ -284,26 +291,26 @@ void gen_precision_rwy( const TGRunway& rwy_info,
snum = rwy_info.rwy_no.substr(0, i); snum = rwy_info.rwy_no.substr(0, i);
} }
} }
SG_LOG(SG_GENERAL, SG_DEBUG, "Runway num = '" << snum << "'"); SG_LOG(SG_GENERAL, SG_INFO, "Runway num = '" << snum << "'");
int num = atoi( snum.c_str() ); int num = atoi( snum.c_str() );
while ( num <= 0 ) { while ( num <= 0 ) {
num += 36; num += 36;
} }
start1_pct = end1_pct; start2_pct = end2_pct;
end1_pct = start1_pct + ( 90.0 / length ); end2_pct = start2_pct + ( 80.0 / length );
gen_number_block( rwy_info, material, runway_a, rwy_info.heading, gen_number_block( rwy_info, material, runway_b, rwy_info.heading + 180.0,
num, start1_pct, end1_pct, rwy_polys, texparams, accum ); num, start2_pct, end2_pct, rwy_polys, texparams, accum );
num += 18; num += 18;
while ( num > 36 ) { while ( num > 36 ) {
num -= 36; num -= 36;
} }
start2_pct = end2_pct; start1_pct = end1_pct;
end2_pct = start2_pct + ( 90.0 / length ); end1_pct = start1_pct + ( 80.0 / length );
gen_number_block( rwy_info, material, runway_b, rwy_info.heading + 180.0, gen_number_block( rwy_info, material, runway_a, rwy_info.heading,
num, start2_pct, end2_pct, rwy_polys, texparams, accum ); num, start1_pct, end1_pct, rwy_polys, texparams, accum );
// //
// Touch down zone x3 // Touch down zone x3
@ -566,11 +573,11 @@ void gen_precision_rwy( const TGRunway& rwy_info,
// section at the end. // section at the end.
double ideal_rest_inc = ( 200.0 / length ); double ideal_rest_inc = ( 200.0 / length );
int divs = (int)((1.0 - end1_pct) / ideal_rest_inc) + 1; int divs = (int)((1.0 - end1_pct) / ideal_rest_inc) + 1;
double rest_inc = (1.0 - end1_pct) / divs; double rest1_inc = (1.0 - end1_pct) / divs;
while ( end1_pct < 1.0 ) { while ( end1_pct < 1.0 ) {
start1_pct = end1_pct; start1_pct = end1_pct;
end1_pct = start1_pct + rest_inc; end1_pct = start1_pct + rest1_inc;
gen_runway_section( rwy_info, runway_a, gen_runway_section( rwy_info, runway_a,
start1_pct, end1_pct, start1_pct, end1_pct,
@ -581,9 +588,13 @@ void gen_precision_rwy( const TGRunway& rwy_info,
rwy_polys, texparams, accum ); rwy_polys, texparams, accum );
} }
ideal_rest_inc = ( 200.0 / length );
divs = (int)((1.0 - end2_pct) / ideal_rest_inc) + 1;
double rest2_inc = (1.0 - end2_pct) / divs;
while ( end2_pct < 1.0 ) { while ( end2_pct < 1.0 ) {
start2_pct = end2_pct; start2_pct = end2_pct;
end2_pct = start2_pct + rest_inc; end2_pct = start2_pct + rest2_inc;
gen_runway_section( rwy_info, runway_b, gen_runway_section( rwy_info, runway_b,
start2_pct, end2_pct, start2_pct, end2_pct,

View file

@ -97,15 +97,142 @@ void gen_visual_rwy( const TGRunway& rwy_info,
"This runway is not long enough for visual markings!"); "This runway is not long enough for visual markings!");
} }
double start_pct = 0; double start1_pct = 0.0;
double end_pct = 0; double start2_pct = 0.0;
double end1_pct = 0.0;
double end2_pct = 0.0;
//
// Displaced threshold if it exists
//
if ( rwy_info.disp_thresh1 > 0.0 ) {
SG_LOG( SG_GENERAL, SG_INFO, "Forward displaced threshold = "
<< rwy_info.disp_thresh1 );
// reserve 90' for final arrows
double thresh = rwy_info.disp_thresh1 - 90.0;
// number of full center arrows
int count = (int)(thresh / 200.0);
// length of starting partial arrow
double part_len = thresh - ( count * 200.0 );
double tex_pct = (200.0 - part_len) / 200.0;
// starting (possibly partial chunk)
start2_pct = end2_pct;
end2_pct = start2_pct + ( part_len / length );
gen_runway_section( rwy_info, runway_b,
start2_pct, end2_pct,
0.0, 1.0,
0.0, 1.0, tex_pct, 1.0,
rwy_info.heading + 180.0,
material, "dspl_thresh",
rwy_polys, texparams, accum );
// main chunks
for ( i = 0; i < count; ++i ) {
start2_pct = end2_pct;
end2_pct = start2_pct + ( 200.0 / length );
gen_runway_section( rwy_info, runway_b,
start2_pct, end2_pct,
0.0, 1.0,
0.0, 1.0, 0.0, 1.0,
rwy_info.heading + 180.0,
material, "dspl_thresh",
rwy_polys, texparams, accum );
}
// final arrows
start2_pct = end2_pct;
end2_pct = start2_pct + ( 90.0 / length );
gen_runway_section( rwy_info, runway_b,
start2_pct, end2_pct,
0.0, 1.0,
0.0, 1.0, 0.0, 1.0,
rwy_info.heading + 180.0,
material, "dspl_arrows",
rwy_polys, texparams, accum );
}
if ( rwy_info.disp_thresh2 > 0.0 ) {
SG_LOG( SG_GENERAL, SG_INFO, "Reverse displaced threshold = "
<< rwy_info.disp_thresh2 );
// reserve 90' for final arrows
double thresh = rwy_info.disp_thresh2 - 90.0;
// number of full center arrows
int count = (int)(thresh / 200.0);
// length of starting partial arrow
double part_len = thresh - ( count * 200.0 );
double tex_pct = (200.0 - part_len) / 200.0;
// starting (possibly partial chunk)
start1_pct = end1_pct;
end1_pct = start1_pct + ( part_len / length );
gen_runway_section( rwy_info, runway_a,
start1_pct, end1_pct,
0.0, 1.0,
0.0, 1.0, tex_pct, 1.0,
rwy_info.heading,
material, "dspl_thresh",
rwy_polys, texparams, accum );
// main chunks
for ( i = 0; i < count; ++i ) {
start1_pct = end1_pct;
end1_pct = start1_pct + ( 200.0 / length );
gen_runway_section( rwy_info, runway_a,
start1_pct, end1_pct,
0.0, 1.0,
0.0, 1.0, 0.0, 1.0,
rwy_info.heading,
material, "dspl_thresh",
rwy_polys, texparams, accum );
}
// final arrows
start1_pct = end1_pct;
end1_pct = start1_pct + ( 90.0 / length );
gen_runway_section( rwy_info, runway_a,
start1_pct, end1_pct,
0.0, 1.0,
0.0, 1.0, 0.0, 1.0,
rwy_info.heading,
material, "dspl_arrows",
rwy_polys, texparams, accum );
}
// //
// Threshold // Threshold
// //
// we to put a mini threshold in here some how if we can.... // mini threshold
// starting (possibly partial chunk)
start1_pct = end1_pct;
end1_pct = start1_pct + ( 14 / length );
gen_runway_section( rwy_info, runway_a,
start1_pct, end1_pct,
0.0, 1.0,
0.0, 1.0, 0.0, 0.07,
rwy_info.heading,
material, "threshold",
rwy_polys, texparams, accum );
// starting (possibly partial chunk)
start2_pct = end2_pct;
end2_pct = start2_pct + ( 14 / length );
gen_runway_section( rwy_info, runway_b,
start2_pct, end2_pct,
0.0, 1.0,
0.0, 1.0, 0.0, 0.07,
rwy_info.heading + 180.0,
material, "threshold",
rwy_polys, texparams, accum );
// //
// Runway designation letter // Runway designation letter
@ -132,18 +259,20 @@ void gen_visual_rwy( const TGRunway& rwy_info,
SG_LOG(SG_GENERAL, SG_DEBUG, "Runway designation letter = " << letter); SG_LOG(SG_GENERAL, SG_DEBUG, "Runway designation letter = " << letter);
if ( !letter.empty() ) { if ( !letter.empty() ) {
start_pct = end_pct; start1_pct = end1_pct;
end_pct = start_pct + ( 90.0 / length ); end1_pct = start1_pct + ( 90.0 / length );
gen_runway_section( rwy_info, runway_a, gen_runway_section( rwy_info, runway_a,
start_pct, end_pct, start1_pct, end1_pct,
0.0, 1.0, 0.0, 1.0,
0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0,
rwy_info.heading, rwy_info.heading,
material, rev_letter, material, rev_letter,
rwy_polys, texparams, accum ); rwy_polys, texparams, accum );
start2_pct = end2_pct;
end2_pct = start2_pct + ( 90.0 / length );
gen_runway_section( rwy_info, runway_b, gen_runway_section( rwy_info, runway_b,
start_pct, end_pct, start2_pct, end2_pct,
0.0, 1.0, 0.0, 1.0,
0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0,
rwy_info.heading + 180.0, rwy_info.heading + 180.0,
@ -155,9 +284,6 @@ void gen_visual_rwy( const TGRunway& rwy_info,
// Runway designation number(s) // Runway designation number(s)
// //
start_pct = end_pct;
end_pct = start_pct + ( 100.0 / length );
len = rwy_info.rwy_no.length(); len = rwy_info.rwy_no.length();
string snum = rwy_info.rwy_no; string snum = rwy_info.rwy_no;
for ( i = 0; i < len; ++i ) { for ( i = 0; i < len; ++i ) {
@ -172,87 +298,72 @@ void gen_visual_rwy( const TGRunway& rwy_info,
num += 36; num += 36;
} }
start2_pct = end2_pct;
end2_pct = start2_pct + ( 80.0 / length );
gen_number_block( rwy_info, material, runway_b, rwy_info.heading + 180.0, gen_number_block( rwy_info, material, runway_b, rwy_info.heading + 180.0,
num, start_pct, end_pct, rwy_polys, texparams, accum ); num, start2_pct, end2_pct, rwy_polys, texparams, accum );
num += 18; num += 18;
while ( num > 36 ) { while ( num > 36 ) {
num -= 36; num -= 36;
} }
start1_pct = end1_pct;
end1_pct = start1_pct + ( 80.0 / length );
gen_number_block( rwy_info, material, runway_a, rwy_info.heading, gen_number_block( rwy_info, material, runway_a, rwy_info.heading,
num, start_pct, end_pct, rwy_polys, texparams, accum ); num, start1_pct, end1_pct, rwy_polys, texparams, accum );
if ( false ) { if ( false ) {
// //
// Intermediate area before aiming point ... // Intermediate area before aiming point ...
// //
if ( end_pct >= 1.0 ) { for ( i = 0; i < 3; ++i ) {
return; start1_pct = end1_pct;
} end1_pct = start1_pct + ( 200 / length );
gen_runway_section( rwy_info, runway_a,
start1_pct, end1_pct,
0.0, 1.0,
0.0, 1.0, 0.0, 1.0,
rwy_info.heading,
material, "centerline",
rwy_polys, texparams, accum );
start_pct = end_pct; start2_pct = end2_pct;
end_pct = start_pct + ( 450.0 / length ); end2_pct = start2_pct + ( 200 / length );
gen_runway_section( rwy_info, runway_a, gen_runway_section( rwy_info, runway_b,
start_pct, end_pct, start2_pct, end2_pct,
0.0, 1.0, 0.0, 1.0,
0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0,
rwy_info.heading, rwy_info.heading + 180.0,
material, "rest", material, "centerline",
rwy_polys, texparams, accum ); rwy_polys, texparams, accum );
}
gen_runway_section( rwy_info, runway_b,
start_pct, end_pct,
0.0, 1.0,
0.0, 1.0, 0.0, 1.0,
rwy_info.heading + 180.0,
material, "rest",
rwy_polys, texparams, accum );
if ( end_pct >= 1.0 ) {
return;
}
start_pct = end_pct;
end_pct = start_pct + ( 450.0 / length );
gen_runway_section( rwy_info, runway_a,
start_pct, end_pct,
0.0, 1.0,
0.0, 1.0, 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,
0.0, 1.0, 0.0, 1.0,
rwy_info.heading + 180.0,
material, "rest",
rwy_polys, texparams, accum );
// //
// Aiming point // Aiming point
// //
if ( end_pct >= 1.0 ) { if ( end1_pct >= 1.0 ) {
return; return;
} }
start1_pct = end1_pct;
start_pct = end_pct; end1_pct = start1_pct + ( 400 / length );
end_pct = start_pct + ( 500 / length );
if ( end_pct > 1.0 ) { end_pct = 1.0; }
gen_runway_section( rwy_info, runway_a, gen_runway_section( rwy_info, runway_a,
start_pct, end_pct, start1_pct, end1_pct,
0.0, 1.0, 0.0, 1.0,
0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0,
rwy_info.heading, rwy_info.heading,
material, "aim", material, "aim",
rwy_polys, texparams, accum ); rwy_polys, texparams, accum );
if ( end2_pct >= 1.0 ) {
return;
}
start2_pct = end2_pct;
end2_pct = start2_pct + ( 400 / length );
gen_runway_section( rwy_info, runway_b, gen_runway_section( rwy_info, runway_b,
start_pct, end_pct, start2_pct, end2_pct,
0.0, 1.0, 0.0, 1.0,
0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0,
rwy_info.heading + 180.0, rwy_info.heading + 180.0,
@ -268,23 +379,33 @@ void gen_visual_rwy( const TGRunway& rwy_info,
// the remaining distance so we don't end up with a super short // the remaining distance so we don't end up with a super short
// section at the end. // section at the end.
double ideal_rest_inc = ( 200.0 / length ); double ideal_rest_inc = ( 200.0 / length );
int divs = (int)((1.0 - end_pct) / ideal_rest_inc) + 1; int divs = (int)((1.0 - end1_pct) / ideal_rest_inc) + 1;
double rest_inc = (1.0 - end_pct) / divs; double rest1_inc = (1.0 - end1_pct) / divs;
while ( end_pct < 1.0 ) { while ( end1_pct < 1.0 ) {
start_pct = end_pct; start1_pct = end1_pct;
end_pct = start_pct + rest_inc; end1_pct = start1_pct + rest1_inc;
cout << "start1 = " << start1_pct << " end1 = " << end1_pct << endl;
gen_runway_section( rwy_info, runway_a, gen_runway_section( rwy_info, runway_a,
start_pct, end_pct, start1_pct, end1_pct,
0.0, 1.0, 0.0, 1.0,
0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0,
rwy_info.heading, rwy_info.heading,
material, "rest", material, "rest",
rwy_polys, texparams, accum ); rwy_polys, texparams, accum );
}
ideal_rest_inc = ( 200.0 / length );
divs = (int)((1.0 - end2_pct) / ideal_rest_inc) + 1;
double rest2_inc = (1.0 - end2_pct) / divs;
while ( end2_pct < 1.0 ) {
start2_pct = end2_pct;
end2_pct = start2_pct + rest2_inc;
gen_runway_section( rwy_info, runway_b, gen_runway_section( rwy_info, runway_b,
start_pct, end_pct, start2_pct, end2_pct,
0.0, 1.0, 0.0, 1.0,
0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0,
rwy_info.heading + 180.0, rwy_info.heading + 180.0,