Tweaked to handle concrete textures as well as turf and dirt runways.
This commit is contained in:
parent
4a68b387df
commit
de4f235115
1 changed files with 306 additions and 300 deletions
|
@ -665,15 +665,16 @@ static void gen_simple_rwy( const FGRunway& rwy_info, const string& material,
|
||||||
|
|
||||||
|
|
||||||
// generate a section of runway
|
// generate a section of runway
|
||||||
static void gen_precision_section( const FGRunway& rwy_info,
|
static void gen_runway_section( const FGRunway& rwy_info,
|
||||||
const FGPolygon& runway,
|
const FGPolygon& runway,
|
||||||
double startl_pct, double endl_pct,
|
double startl_pct, double endl_pct,
|
||||||
double startw_pct, double endw_pct,
|
double startw_pct, double endw_pct,
|
||||||
double heading,
|
double heading,
|
||||||
const string& material,
|
const string& prefix,
|
||||||
superpoly_list *rwy_polys,
|
const string& material,
|
||||||
texparams_list *texparams,
|
superpoly_list *rwy_polys,
|
||||||
FGPolygon *accum ) {
|
texparams_list *texparams,
|
||||||
|
FGPolygon *accum ) {
|
||||||
|
|
||||||
Point3D a0 = runway.get_pt(0, 1);
|
Point3D a0 = runway.get_pt(0, 1);
|
||||||
Point3D a1 = runway.get_pt(0, 2);
|
Point3D a1 = runway.get_pt(0, 2);
|
||||||
|
@ -725,7 +726,7 @@ static void gen_precision_section( const FGRunway& rwy_info,
|
||||||
section.add_node( 0, p2 );
|
section.add_node( 0, p2 );
|
||||||
|
|
||||||
// print runway points
|
// print runway points
|
||||||
cout << "pre clipped runway pts " << material << endl;
|
cout << "pre clipped runway pts " << prefix << material << endl;
|
||||||
for ( int j = 0; j < section.contours(); ++j ) {
|
for ( int j = 0; j < section.contours(); ++j ) {
|
||||||
for ( int k = 0; k < section.contour_size( j ); ++k ) {
|
for ( int k = 0; k < section.contour_size( j ); ++k ) {
|
||||||
Point3D p = section.get_pt(j, k);
|
Point3D p = section.get_pt(j, k);
|
||||||
|
@ -738,7 +739,7 @@ static void gen_precision_section( const FGRunway& rwy_info,
|
||||||
FGSuperPoly sp;
|
FGSuperPoly sp;
|
||||||
sp.erase();
|
sp.erase();
|
||||||
sp.set_poly( split );
|
sp.set_poly( split );
|
||||||
sp.set_material( material );
|
sp.set_material( prefix + material );
|
||||||
rwy_polys->push_back( sp );
|
rwy_polys->push_back( sp );
|
||||||
cout << "section = " << clipped.contours() << endl;
|
cout << "section = " << clipped.contours() << endl;
|
||||||
*accum = polygon_union( section, *accum );
|
*accum = polygon_union( section, *accum );
|
||||||
|
@ -763,7 +764,7 @@ static void gen_precision_section( const FGRunway& rwy_info,
|
||||||
texparams->push_back( tp );
|
texparams->push_back( tp );
|
||||||
|
|
||||||
// print runway points
|
// print runway points
|
||||||
cout << "clipped runway pts " << material << endl;
|
cout << "clipped runway pts " << prefix + material << endl;
|
||||||
for ( int j = 0; j < clipped.contours(); ++j ) {
|
for ( int j = 0; j < clipped.contours(); ++j ) {
|
||||||
for ( int k = 0; k < clipped.contour_size( j ); ++k ) {
|
for ( int k = 0; k < clipped.contour_size( j ); ++k ) {
|
||||||
Point3D p = clipped.get_pt(j, k);
|
Point3D p = clipped.get_pt(j, k);
|
||||||
|
@ -773,7 +774,8 @@ static void gen_precision_section( const FGRunway& rwy_info,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void gen_number_block( const FGRunway& rwy_info, const string& material,
|
static void gen_number_block( const FGRunway& rwy_info,
|
||||||
|
const string& material,
|
||||||
FGPolygon poly, double heading, int num,
|
FGPolygon poly, double heading, int num,
|
||||||
double start_pct, double end_pct,
|
double start_pct, double end_pct,
|
||||||
superpoly_list *rwy_polys,
|
superpoly_list *rwy_polys,
|
||||||
|
@ -787,71 +789,71 @@ static void gen_number_block( const FGRunway& rwy_info, const string& material,
|
||||||
|
|
||||||
// special cases
|
// special cases
|
||||||
if ( num == 1 ) {
|
if ( num == 1 ) {
|
||||||
sprintf( tex1, "pa_01" );
|
sprintf( tex1, "01" );
|
||||||
} else if ( num == 11 ) {
|
} else if ( num == 11 ) {
|
||||||
sprintf( tex1, "pa_11" );
|
sprintf( tex1, "11" );
|
||||||
} else if ( num < 10 ) {
|
} else if ( num < 10 ) {
|
||||||
sprintf( tex1, "pa_%d", num );
|
sprintf( tex1, "%d", num );
|
||||||
} else {
|
} else {
|
||||||
sprintf( tex1, "pa_%d", num / 10 );
|
sprintf( tex1, "%d", num / 10 );
|
||||||
sprintf( tex2, "pa_%d", num - (num / 10 * 10));
|
sprintf( tex2, "%d", num - (num / 10 * 10));
|
||||||
}
|
}
|
||||||
|
|
||||||
// printf("tex1 = '%s' tex2 = '%s'\n", tex1, tex2);
|
// printf("tex1 = '%s' tex2 = '%s'\n", tex1, tex2);
|
||||||
|
|
||||||
if ( num < 10 ) {
|
if ( num < 10 ) {
|
||||||
gen_precision_section( rwy_info, poly,
|
gen_runway_section( rwy_info, poly,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
0.0, 0.366,
|
0.0, 0.366,
|
||||||
heading,
|
heading,
|
||||||
"pa_des_fill_w",
|
material, "des_fill_w",
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
gen_precision_section( rwy_info, poly,
|
gen_runway_section( rwy_info, poly,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
0.366, 0.634,
|
0.366, 0.634,
|
||||||
heading,
|
heading,
|
||||||
tex1,
|
material, tex1,
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
gen_precision_section( rwy_info, poly,
|
gen_runway_section( rwy_info, poly,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
1.0, 0.634,
|
1.0, 0.634,
|
||||||
heading,
|
heading,
|
||||||
"pa_des_fill_w",
|
material, "des_fill_w",
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
} else {
|
} else {
|
||||||
gen_precision_section( rwy_info, poly,
|
gen_runway_section( rwy_info, poly,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
0.0, 0.231,
|
0.0, 0.231,
|
||||||
heading,
|
heading,
|
||||||
"pa_des_fill_n",
|
material, "des_fill_n",
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
if ( num == 11 ) {
|
if ( num == 11 ) {
|
||||||
gen_precision_section( rwy_info, poly,
|
gen_runway_section( rwy_info, poly,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
0.231, 0.731,
|
0.231, 0.731,
|
||||||
heading,
|
heading,
|
||||||
tex1,
|
material, tex1,
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
} else {
|
} else {
|
||||||
gen_precision_section( rwy_info, poly,
|
gen_runway_section( rwy_info, poly,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
0.231, 0.5,
|
0.231, 0.5,
|
||||||
heading,
|
heading,
|
||||||
tex1,
|
material, tex1,
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
gen_precision_section( rwy_info, poly,
|
gen_runway_section( rwy_info, poly,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
0.5, 0.731,
|
0.5, 0.731,
|
||||||
heading,
|
heading,
|
||||||
tex2,
|
material, tex2,
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
}
|
}
|
||||||
gen_precision_section( rwy_info, poly,
|
gen_runway_section( rwy_info, poly,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
1.0, 0.731,
|
1.0, 0.731,
|
||||||
heading,
|
heading,
|
||||||
"pa_des_fill_n",
|
material, "des_fill_n",
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -861,7 +863,8 @@ static void gen_number_block( const FGRunway& rwy_info, const string& material,
|
||||||
// dimensions of precision runway markings, please refer to FAA
|
// dimensions of precision runway markings, please refer to FAA
|
||||||
// document AC 150/5340-1H
|
// document AC 150/5340-1H
|
||||||
|
|
||||||
static void gen_precision_rwy( const FGRunway& rwy_info, const string& material,
|
static void gen_precision_rwy( const FGRunway& rwy_info,
|
||||||
|
const string& material,
|
||||||
superpoly_list *rwy_polys,
|
superpoly_list *rwy_polys,
|
||||||
texparams_list *texparams,
|
texparams_list *texparams,
|
||||||
FGPolygon *accum )
|
FGPolygon *accum )
|
||||||
|
@ -924,19 +927,19 @@ static void gen_precision_rwy( const FGRunway& rwy_info, const string& material,
|
||||||
//
|
//
|
||||||
|
|
||||||
end_pct = start_pct + ( 190.0 / length );
|
end_pct = start_pct + ( 190.0 / length );
|
||||||
gen_precision_section( rwy_info, runway_a,
|
gen_runway_section( rwy_info, runway_a,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
0.0, 1.0,
|
0.0, 1.0,
|
||||||
rwy_info.heading,
|
rwy_info.heading,
|
||||||
"pa_threshold",
|
material, "threshold",
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
|
|
||||||
gen_precision_section( rwy_info, runway_b,
|
gen_runway_section( rwy_info, runway_b,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
0.0, 1.0,
|
0.0, 1.0,
|
||||||
rwy_info.heading + 180.0,
|
rwy_info.heading + 180.0,
|
||||||
"pa_threshold",
|
material, "threshold",
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
|
|
||||||
//
|
//
|
||||||
// Runway designation letter
|
// Runway designation letter
|
||||||
|
@ -948,14 +951,14 @@ static void gen_precision_rwy( const FGRunway& rwy_info, const string& material,
|
||||||
for ( int i = 0; i < len; ++i ) {
|
for ( int i = 0; i < len; ++i ) {
|
||||||
string tmp = rwy_info.rwy_no.substr(i, 1);
|
string tmp = rwy_info.rwy_no.substr(i, 1);
|
||||||
if ( tmp == "L" ) {
|
if ( tmp == "L" ) {
|
||||||
letter = "pa_L";
|
letter = "L";
|
||||||
rev_letter = "pa_R";
|
rev_letter = "R";
|
||||||
} else if ( tmp == "R" ) {
|
} else if ( tmp == "R" ) {
|
||||||
letter = "pa_R";
|
letter = "R";
|
||||||
rev_letter = "pa_L";
|
rev_letter = "L";
|
||||||
} else if ( tmp == "C" ) {
|
} else if ( tmp == "C" ) {
|
||||||
letter == "pa_C";
|
letter == "C";
|
||||||
rev_letter = "pa_C";
|
rev_letter = "C";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -965,19 +968,19 @@ static void gen_precision_rwy( const FGRunway& rwy_info, const string& material,
|
||||||
if ( letter != "" ) {
|
if ( letter != "" ) {
|
||||||
start_pct = end_pct;
|
start_pct = end_pct;
|
||||||
end_pct = start_pct + ( 90.0 / length );
|
end_pct = start_pct + ( 90.0 / length );
|
||||||
gen_precision_section( rwy_info, runway_a,
|
gen_runway_section( rwy_info, runway_a,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
0.0, 1.0,
|
0.0, 1.0,
|
||||||
rwy_info.heading,
|
rwy_info.heading,
|
||||||
rev_letter,
|
material, rev_letter,
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
|
|
||||||
gen_precision_section( rwy_info, runway_b,
|
gen_runway_section( rwy_info, runway_b,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
0.0, 1.0,
|
0.0, 1.0,
|
||||||
rwy_info.heading + 180.0,
|
rwy_info.heading + 180.0,
|
||||||
letter,
|
material, letter,
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -1015,19 +1018,19 @@ static void gen_precision_rwy( const FGRunway& rwy_info, const string& material,
|
||||||
|
|
||||||
start_pct = end_pct;
|
start_pct = end_pct;
|
||||||
end_pct = start_pct + ( 650 / length );
|
end_pct = start_pct + ( 650 / length );
|
||||||
gen_precision_section( rwy_info, runway_a,
|
gen_runway_section( rwy_info, runway_a,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
0.0, 1.0,
|
0.0, 1.0,
|
||||||
rwy_info.heading,
|
rwy_info.heading,
|
||||||
"pa_tz_three",
|
material, "tz_three",
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
|
|
||||||
gen_precision_section( rwy_info, runway_b,
|
gen_runway_section( rwy_info, runway_b,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
0.0, 1.0,
|
0.0, 1.0,
|
||||||
rwy_info.heading + 180.0,
|
rwy_info.heading + 180.0,
|
||||||
"pa_tz_three",
|
material, "tz_three",
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
|
|
||||||
//
|
//
|
||||||
// Aiming point
|
// Aiming point
|
||||||
|
@ -1035,19 +1038,19 @@ static void gen_precision_rwy( const FGRunway& rwy_info, const string& material,
|
||||||
|
|
||||||
start_pct = end_pct;
|
start_pct = end_pct;
|
||||||
end_pct = start_pct + ( 500 / length );
|
end_pct = start_pct + ( 500 / length );
|
||||||
gen_precision_section( rwy_info, runway_a,
|
gen_runway_section( rwy_info, runway_a,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
0.0, 1.0,
|
0.0, 1.0,
|
||||||
rwy_info.heading,
|
rwy_info.heading,
|
||||||
"pa_aim",
|
material, "aim",
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
|
|
||||||
gen_precision_section( rwy_info, runway_b,
|
gen_runway_section( rwy_info, runway_b,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
0.0, 1.0,
|
0.0, 1.0,
|
||||||
rwy_info.heading + 180.0,
|
rwy_info.heading + 180.0,
|
||||||
"pa_aim",
|
material, "aim",
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
|
|
||||||
//
|
//
|
||||||
// Touch down zone x2 (first)
|
// Touch down zone x2 (first)
|
||||||
|
@ -1055,19 +1058,19 @@ static void gen_precision_rwy( const FGRunway& rwy_info, const string& material,
|
||||||
|
|
||||||
start_pct = end_pct;
|
start_pct = end_pct;
|
||||||
end_pct = start_pct + ( 500 / length );
|
end_pct = start_pct + ( 500 / length );
|
||||||
gen_precision_section( rwy_info, runway_a,
|
gen_runway_section( rwy_info, runway_a,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
0.0, 1.0,
|
0.0, 1.0,
|
||||||
rwy_info.heading,
|
rwy_info.heading,
|
||||||
"pa_tz_two_a",
|
material, "tz_two_a",
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
|
|
||||||
gen_precision_section( rwy_info, runway_b,
|
gen_runway_section( rwy_info, runway_b,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
0.0, 1.0,
|
0.0, 1.0,
|
||||||
rwy_info.heading + 180.0,
|
rwy_info.heading + 180.0,
|
||||||
"pa_tz_two_a",
|
material, "tz_two_a",
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
|
|
||||||
//
|
//
|
||||||
// Touch down zone x2 (second)
|
// Touch down zone x2 (second)
|
||||||
|
@ -1075,19 +1078,19 @@ static void gen_precision_rwy( const FGRunway& rwy_info, const string& material,
|
||||||
|
|
||||||
start_pct = end_pct;
|
start_pct = end_pct;
|
||||||
end_pct = start_pct + ( 500 / length );
|
end_pct = start_pct + ( 500 / length );
|
||||||
gen_precision_section( rwy_info, runway_a,
|
gen_runway_section( rwy_info, runway_a,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
0.0, 1.0,
|
0.0, 1.0,
|
||||||
rwy_info.heading,
|
rwy_info.heading,
|
||||||
"pa_tz_two_b",
|
material, "tz_two_b",
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
|
|
||||||
gen_precision_section( rwy_info, runway_b,
|
gen_runway_section( rwy_info, runway_b,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
0.0, 1.0,
|
0.0, 1.0,
|
||||||
rwy_info.heading + 180.0,
|
rwy_info.heading + 180.0,
|
||||||
"pa_tz_two_b",
|
material, "tz_two_b",
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
|
|
||||||
//
|
//
|
||||||
// Touch down zone x1 (first)
|
// Touch down zone x1 (first)
|
||||||
|
@ -1095,19 +1098,19 @@ static void gen_precision_rwy( const FGRunway& rwy_info, const string& material,
|
||||||
|
|
||||||
start_pct = end_pct;
|
start_pct = end_pct;
|
||||||
end_pct = start_pct + ( 500 / length );
|
end_pct = start_pct + ( 500 / length );
|
||||||
gen_precision_section( rwy_info, runway_a,
|
gen_runway_section( rwy_info, runway_a,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
0.0, 1.0,
|
0.0, 1.0,
|
||||||
rwy_info.heading,
|
rwy_info.heading,
|
||||||
"pa_tz_one_a",
|
material, "tz_one_a",
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
|
|
||||||
gen_precision_section( rwy_info, runway_b,
|
gen_runway_section( rwy_info, runway_b,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
0.0, 1.0,
|
0.0, 1.0,
|
||||||
rwy_info.heading + 180.0,
|
rwy_info.heading + 180.0,
|
||||||
"pa_tz_one_a",
|
material, "tz_one_a",
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
|
|
||||||
//
|
//
|
||||||
// Touch down zone x1 (second)
|
// Touch down zone x1 (second)
|
||||||
|
@ -1115,19 +1118,19 @@ static void gen_precision_rwy( const FGRunway& rwy_info, const string& material,
|
||||||
|
|
||||||
start_pct = end_pct;
|
start_pct = end_pct;
|
||||||
end_pct = start_pct + ( 500 / length );
|
end_pct = start_pct + ( 500 / length );
|
||||||
gen_precision_section( rwy_info, runway_a,
|
gen_runway_section( rwy_info, runway_a,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
0.0, 1.0,
|
0.0, 1.0,
|
||||||
rwy_info.heading,
|
rwy_info.heading,
|
||||||
"pa_tz_one_b",
|
material, "tz_one_b",
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
|
|
||||||
gen_precision_section( rwy_info, runway_b,
|
gen_runway_section( rwy_info, runway_b,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
0.0, 1.0,
|
0.0, 1.0,
|
||||||
rwy_info.heading + 180.0,
|
rwy_info.heading + 180.0,
|
||||||
"pa_tz_one_b",
|
material, "tz_one_b",
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
|
|
||||||
//
|
//
|
||||||
// The rest ...
|
// The rest ...
|
||||||
|
@ -1135,19 +1138,19 @@ static void gen_precision_rwy( const FGRunway& rwy_info, const string& material,
|
||||||
|
|
||||||
start_pct = end_pct;
|
start_pct = end_pct;
|
||||||
end_pct = 1.0;
|
end_pct = 1.0;
|
||||||
gen_precision_section( rwy_info, runway_a,
|
gen_runway_section( rwy_info, runway_a,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
0.0, 1.0,
|
0.0, 1.0,
|
||||||
rwy_info.heading,
|
rwy_info.heading,
|
||||||
"pa_rest",
|
material, "rest",
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
|
|
||||||
gen_precision_section( rwy_info, runway_b,
|
gen_runway_section( rwy_info, runway_b,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
0.0, 1.0,
|
0.0, 1.0,
|
||||||
rwy_info.heading + 180.0,
|
rwy_info.heading + 180.0,
|
||||||
"pa_rest",
|
material, "rest",
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1220,19 +1223,19 @@ static void gen_non_precision_rwy( const FGRunway& rwy_info,
|
||||||
//
|
//
|
||||||
|
|
||||||
end_pct = start_pct + ( 190.0 / length );
|
end_pct = start_pct + ( 190.0 / length );
|
||||||
gen_precision_section( rwy_info, runway_a,
|
gen_runway_section( rwy_info, runway_a,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
0.0, 1.0,
|
0.0, 1.0,
|
||||||
rwy_info.heading,
|
rwy_info.heading,
|
||||||
"pa_threshold",
|
material, "threshold",
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
|
|
||||||
gen_precision_section( rwy_info, runway_b,
|
gen_runway_section( rwy_info, runway_b,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
0.0, 1.0,
|
0.0, 1.0,
|
||||||
rwy_info.heading + 180.0,
|
rwy_info.heading + 180.0,
|
||||||
"pa_threshold",
|
material, "threshold",
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
|
|
||||||
//
|
//
|
||||||
// Runway designation number(s)
|
// Runway designation number(s)
|
||||||
|
@ -1269,35 +1272,35 @@ static void gen_non_precision_rwy( const FGRunway& rwy_info,
|
||||||
|
|
||||||
start_pct = end_pct;
|
start_pct = end_pct;
|
||||||
end_pct = start_pct + ( 360.0 / length );
|
end_pct = start_pct + ( 360.0 / length );
|
||||||
gen_precision_section( rwy_info, runway_a,
|
gen_runway_section( rwy_info, runway_a,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
0.0, 1.0,
|
0.0, 1.0,
|
||||||
rwy_info.heading,
|
rwy_info.heading,
|
||||||
"pa_rest",
|
material, "rest",
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
|
|
||||||
gen_precision_section( rwy_info, runway_b,
|
gen_runway_section( rwy_info, runway_b,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
0.0, 1.0,
|
0.0, 1.0,
|
||||||
rwy_info.heading + 180.0,
|
rwy_info.heading + 180.0,
|
||||||
"pa_rest",
|
material, "rest",
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
|
|
||||||
start_pct = end_pct;
|
start_pct = end_pct;
|
||||||
end_pct = start_pct + ( 360.0 / length );
|
end_pct = start_pct + ( 360.0 / length );
|
||||||
gen_precision_section( rwy_info, runway_a,
|
gen_runway_section( rwy_info, runway_a,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
0.0, 1.0,
|
0.0, 1.0,
|
||||||
rwy_info.heading,
|
rwy_info.heading,
|
||||||
"pa_rest",
|
material, "rest",
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
|
|
||||||
gen_precision_section( rwy_info, runway_b,
|
gen_runway_section( rwy_info, runway_b,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
0.0, 1.0,
|
0.0, 1.0,
|
||||||
rwy_info.heading + 180.0,
|
rwy_info.heading + 180.0,
|
||||||
"pa_rest",
|
material, "rest",
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
|
|
||||||
//
|
//
|
||||||
// Aiming point
|
// Aiming point
|
||||||
|
@ -1305,19 +1308,19 @@ static void gen_non_precision_rwy( const FGRunway& rwy_info,
|
||||||
|
|
||||||
start_pct = end_pct;
|
start_pct = end_pct;
|
||||||
end_pct = start_pct + ( 500 / length );
|
end_pct = start_pct + ( 500 / length );
|
||||||
gen_precision_section( rwy_info, runway_a,
|
gen_runway_section( rwy_info, runway_a,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
0.0, 1.0,
|
0.0, 1.0,
|
||||||
rwy_info.heading,
|
rwy_info.heading,
|
||||||
"pa_aim",
|
material, "aim",
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
|
|
||||||
gen_precision_section( rwy_info, runway_b,
|
gen_runway_section( rwy_info, runway_b,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
0.0, 1.0,
|
0.0, 1.0,
|
||||||
rwy_info.heading + 180.0,
|
rwy_info.heading + 180.0,
|
||||||
"pa_aim",
|
material, "aim",
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
|
|
||||||
//
|
//
|
||||||
// The rest ...
|
// The rest ...
|
||||||
|
@ -1325,19 +1328,19 @@ static void gen_non_precision_rwy( const FGRunway& rwy_info,
|
||||||
|
|
||||||
start_pct = end_pct;
|
start_pct = end_pct;
|
||||||
end_pct = 1.0;
|
end_pct = 1.0;
|
||||||
gen_precision_section( rwy_info, runway_a,
|
gen_runway_section( rwy_info, runway_a,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
0.0, 1.0,
|
0.0, 1.0,
|
||||||
rwy_info.heading,
|
rwy_info.heading,
|
||||||
"pa_rest",
|
material, "rest",
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
|
|
||||||
gen_precision_section( rwy_info, runway_b,
|
gen_runway_section( rwy_info, runway_b,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
0.0, 1.0,
|
0.0, 1.0,
|
||||||
rwy_info.heading + 180.0,
|
rwy_info.heading + 180.0,
|
||||||
"pa_rest",
|
material, "rest",
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1347,10 +1350,10 @@ static void gen_non_precision_rwy( const FGRunway& rwy_info,
|
||||||
// 150/5340-1H
|
// 150/5340-1H
|
||||||
|
|
||||||
static void gen_visual_rwy( const FGRunway& rwy_info,
|
static void gen_visual_rwy( const FGRunway& rwy_info,
|
||||||
const string& material,
|
const string& material,
|
||||||
superpoly_list *rwy_polys,
|
superpoly_list *rwy_polys,
|
||||||
texparams_list *texparams,
|
texparams_list *texparams,
|
||||||
FGPolygon *accum )
|
FGPolygon *accum )
|
||||||
{
|
{
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -1441,35 +1444,35 @@ static void gen_non_precision_rwy( const FGRunway& rwy_info,
|
||||||
|
|
||||||
start_pct = end_pct;
|
start_pct = end_pct;
|
||||||
end_pct = start_pct + ( 450.0 / length );
|
end_pct = start_pct + ( 450.0 / length );
|
||||||
gen_precision_section( rwy_info, runway_a,
|
gen_runway_section( rwy_info, runway_a,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
0.0, 1.0,
|
0.0, 1.0,
|
||||||
rwy_info.heading,
|
rwy_info.heading,
|
||||||
"pa_rest",
|
material, "rest",
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
|
|
||||||
gen_precision_section( rwy_info, runway_b,
|
gen_runway_section( rwy_info, runway_b,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
0.0, 1.0,
|
0.0, 1.0,
|
||||||
rwy_info.heading + 180.0,
|
rwy_info.heading + 180.0,
|
||||||
"pa_rest",
|
material, "rest",
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
|
|
||||||
start_pct = end_pct;
|
start_pct = end_pct;
|
||||||
end_pct = start_pct + ( 450.0 / length );
|
end_pct = start_pct + ( 450.0 / length );
|
||||||
gen_precision_section( rwy_info, runway_a,
|
gen_runway_section( rwy_info, runway_a,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
0.0, 1.0,
|
0.0, 1.0,
|
||||||
rwy_info.heading,
|
rwy_info.heading,
|
||||||
"pa_rest",
|
material, "rest",
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
|
|
||||||
gen_precision_section( rwy_info, runway_b,
|
gen_runway_section( rwy_info, runway_b,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
0.0, 1.0,
|
0.0, 1.0,
|
||||||
rwy_info.heading + 180.0,
|
rwy_info.heading + 180.0,
|
||||||
"pa_rest",
|
material, "rest",
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
|
|
||||||
//
|
//
|
||||||
// Aiming point
|
// Aiming point
|
||||||
|
@ -1477,19 +1480,19 @@ static void gen_non_precision_rwy( const FGRunway& rwy_info,
|
||||||
|
|
||||||
start_pct = end_pct;
|
start_pct = end_pct;
|
||||||
end_pct = start_pct + ( 500 / length );
|
end_pct = start_pct + ( 500 / length );
|
||||||
gen_precision_section( rwy_info, runway_a,
|
gen_runway_section( rwy_info, runway_a,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
0.0, 1.0,
|
0.0, 1.0,
|
||||||
rwy_info.heading,
|
rwy_info.heading,
|
||||||
"pa_aim",
|
material, "aim",
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
|
|
||||||
gen_precision_section( rwy_info, runway_b,
|
gen_runway_section( rwy_info, runway_b,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
0.0, 1.0,
|
0.0, 1.0,
|
||||||
rwy_info.heading + 180.0,
|
rwy_info.heading + 180.0,
|
||||||
"pa_aim",
|
material, "aim",
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
|
|
||||||
//
|
//
|
||||||
// The rest ...
|
// The rest ...
|
||||||
|
@ -1497,19 +1500,19 @@ static void gen_non_precision_rwy( const FGRunway& rwy_info,
|
||||||
|
|
||||||
start_pct = end_pct;
|
start_pct = end_pct;
|
||||||
end_pct = 1.0;
|
end_pct = 1.0;
|
||||||
gen_precision_section( rwy_info, runway_a,
|
gen_runway_section( rwy_info, runway_a,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
0.0, 1.0,
|
0.0, 1.0,
|
||||||
rwy_info.heading,
|
rwy_info.heading,
|
||||||
"pa_rest",
|
material, "rest",
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
|
|
||||||
gen_precision_section( rwy_info, runway_b,
|
gen_runway_section( rwy_info, runway_b,
|
||||||
start_pct, end_pct,
|
start_pct, end_pct,
|
||||||
0.0, 1.0,
|
0.0, 1.0,
|
||||||
rwy_info.heading + 180.0,
|
rwy_info.heading + 180.0,
|
||||||
"pa_rest",
|
material, "rest",
|
||||||
rwy_polys, texparams, accum );
|
rwy_polys, texparams, accum );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1627,13 +1630,13 @@ void build_airport( string airport_raw, string_list& runways_raw,
|
||||||
|
|
||||||
string material;
|
string material;
|
||||||
if ( surface_flag == "A" ) {
|
if ( surface_flag == "A" ) {
|
||||||
material = "Asphalt";
|
material = "pa_"; // asphalt
|
||||||
} else if ( surface_flag == "C" ) {
|
} else if ( surface_flag == "C" ) {
|
||||||
material = "Concrete";
|
material = "pc_"; // concrete
|
||||||
} else if ( surface_flag == "D" ) {
|
} else if ( surface_flag == "D" ) {
|
||||||
material = "DryLake";
|
material = "dirt_rwy";
|
||||||
} else if ( surface_flag == "T" ) {
|
} else if ( surface_flag == "T" ) {
|
||||||
material = "Grass";
|
material = "grass_rwy";
|
||||||
} else {
|
} else {
|
||||||
cout << "unknown runway type!" << endl;
|
cout << "unknown runway type!" << endl;
|
||||||
exit(-1);
|
exit(-1);
|
||||||
|
@ -1641,7 +1644,11 @@ void build_airport( string airport_raw, string_list& runways_raw,
|
||||||
|
|
||||||
string type_flag = runways[i].surface_flags.substr(2, 1);
|
string type_flag = runways[i].surface_flags.substr(2, 1);
|
||||||
cout << "type flag = " << type_flag << endl;
|
cout << "type flag = " << type_flag << endl;
|
||||||
if ( type_flag == "P" ) {
|
|
||||||
|
if ( surface_flag == "D" || surface_flag == "T" ) {
|
||||||
|
gen_simple_rwy( runways[i], material,
|
||||||
|
&rwy_polys, &texparams, &accum );
|
||||||
|
} else if ( type_flag == "P" ) {
|
||||||
// precision runway markings
|
// precision runway markings
|
||||||
gen_precision_rwy( runways[i], material,
|
gen_precision_rwy( runways[i], material,
|
||||||
&rwy_polys, &texparams, &accum );
|
&rwy_polys, &texparams, &accum );
|
||||||
|
@ -1655,8 +1662,7 @@ void build_airport( string airport_raw, string_list& runways_raw,
|
||||||
&rwy_polys, &texparams, &accum );
|
&rwy_polys, &texparams, &accum );
|
||||||
} else if ( type_flag == "B" ) {
|
} else if ( type_flag == "B" ) {
|
||||||
// bouys (sea plane base)
|
// bouys (sea plane base)
|
||||||
gen_simple_rwy( runways[i], material,
|
// do nothing for now.
|
||||||
&rwy_polys, &texparams, &accum );
|
|
||||||
} else {
|
} else {
|
||||||
// unknown runway code ... hehe, I know, let's just die
|
// unknown runway code ... hehe, I know, let's just die
|
||||||
// right here so the programmer has to fix his code if a
|
// right here so the programmer has to fix his code if a
|
||||||
|
|
Loading…
Add table
Reference in a new issue