Add ALSF-1, MALS, MALSF, and MALSR.
This commit is contained in:
parent
c2f620744a
commit
b2ee8d6fa3
1 changed files with 459 additions and 44 deletions
|
@ -895,8 +895,8 @@ static FGSuperPoly gen_reil( const FGRunway& rwy_info, float alt_m,
|
|||
|
||||
|
||||
// generate ALSF-II approach lighting scheme
|
||||
static superpoly_list gen_alsf_ii( const FGRunway& rwy_info,
|
||||
float alt_m, bool recip )
|
||||
static superpoly_list gen_alsf( const FGRunway& rwy_info,
|
||||
float alt_m, int kind, bool recip )
|
||||
{
|
||||
point_list g_lights; g_lights.clear();
|
||||
point_list w_lights; w_lights.clear();
|
||||
|
@ -908,7 +908,7 @@ static superpoly_list gen_alsf_ii( const FGRunway& rwy_info,
|
|||
point_list s_normals; s_normals.clear();
|
||||
int i, j;
|
||||
|
||||
cout << "gen ALSF II lights " << rwy_info.rwy_no << endl;
|
||||
cout << "gen ALSF lights " << rwy_info.rwy_no << endl;
|
||||
|
||||
Point3D normal = gen_runway_light_vector( rwy_info, 3.0, recip );
|
||||
|
||||
|
@ -1020,25 +1020,25 @@ static superpoly_list gen_alsf_ii( const FGRunway& rwy_info,
|
|||
w_normals.push_back( normal );
|
||||
}
|
||||
|
||||
// Generate red side row lights
|
||||
|
||||
ref = ref_save;
|
||||
|
||||
for ( i = 0; i < 9; ++i ) {
|
||||
// offset 100' downwind
|
||||
if ( kind == 1 ) {
|
||||
// Terminating bar
|
||||
|
||||
// offset 200' downwind
|
||||
geo_direct_wgs_84 ( alt_m, ref.lat(), ref.lon(), length_hdg,
|
||||
-100 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
-200 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
ref = Point3D( lon, lat, 0.0 );
|
||||
|
||||
pt1 = ref;
|
||||
|
||||
// left 3 side lights
|
||||
geo_direct_wgs_84 ( alt_m, pt1.lat(), pt1.lon(), left_hdg,
|
||||
36 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
15 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
pt1 = Point3D( lon, lat, 0.0 );
|
||||
r_lights.push_back( pt1 );
|
||||
r_normals.push_back( normal );
|
||||
|
||||
|
||||
geo_direct_wgs_84 ( alt_m, pt1.lat(), pt1.lon(), left_hdg,
|
||||
5 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
pt1 = Point3D( lon, lat, 0.0 );
|
||||
|
@ -1055,7 +1055,7 @@ static superpoly_list gen_alsf_ii( const FGRunway& rwy_info,
|
|||
|
||||
// right 3 side lights
|
||||
geo_direct_wgs_84 ( alt_m, pt1.lat(), pt1.lon(), left_hdg,
|
||||
-36 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
-15 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
pt1 = Point3D( lon, lat, 0.0 );
|
||||
r_lights.push_back( pt1 );
|
||||
r_normals.push_back( normal );
|
||||
|
@ -1071,49 +1071,145 @@ static superpoly_list gen_alsf_ii( const FGRunway& rwy_info,
|
|||
pt1 = Point3D( lon, lat, 0.0 );
|
||||
r_lights.push_back( pt1 );
|
||||
r_normals.push_back( normal );
|
||||
}
|
||||
} else if ( kind == 2 ) {
|
||||
// Generate red side row lights
|
||||
|
||||
// Generate -500 extra horizontal row of lights
|
||||
for ( i = 0; i < 9; ++i ) {
|
||||
// offset 100' downwind
|
||||
geo_direct_wgs_84 ( alt_m, ref.lat(), ref.lon(), length_hdg,
|
||||
-100 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
ref = Point3D( lon, lat, 0.0 );
|
||||
|
||||
ref = ref_save;
|
||||
|
||||
// offset 500' downwind
|
||||
geo_direct_wgs_84 ( alt_m, ref.lat(), ref.lon(), length_hdg,
|
||||
-500 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
ref = Point3D( lon, lat, 0.0 );
|
||||
|
||||
pt1 = ref;
|
||||
pt1 = ref;
|
||||
|
||||
// left 4 side lights
|
||||
geo_direct_wgs_84 ( alt_m, pt1.lat(), pt1.lon(), left_hdg,
|
||||
11.5 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
pt1 = Point3D( lon, lat, 0.0 );
|
||||
w_lights.push_back( pt1 );
|
||||
w_normals.push_back( normal );
|
||||
// left 3 side lights
|
||||
geo_direct_wgs_84 ( alt_m, pt1.lat(), pt1.lon(), left_hdg,
|
||||
36 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
pt1 = Point3D( lon, lat, 0.0 );
|
||||
r_lights.push_back( pt1 );
|
||||
r_normals.push_back( normal );
|
||||
|
||||
for ( j = 0; j < 3; ++j ) {
|
||||
geo_direct_wgs_84 ( alt_m, pt1.lat(), pt1.lon(), left_hdg,
|
||||
5 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
pt1 = Point3D( lon, lat, 0.0 );
|
||||
w_lights.push_back( pt1 );
|
||||
w_normals.push_back( normal );
|
||||
geo_direct_wgs_84 ( alt_m, pt1.lat(), pt1.lon(), left_hdg,
|
||||
5 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
pt1 = Point3D( lon, lat, 0.0 );
|
||||
r_lights.push_back( pt1 );
|
||||
r_normals.push_back( normal );
|
||||
|
||||
geo_direct_wgs_84 ( alt_m, pt1.lat(), pt1.lon(), left_hdg,
|
||||
5 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
pt1 = Point3D( lon, lat, 0.0 );
|
||||
r_lights.push_back( pt1 );
|
||||
r_normals.push_back( normal );
|
||||
|
||||
pt1 = ref;
|
||||
|
||||
// right 3 side lights
|
||||
geo_direct_wgs_84 ( alt_m, pt1.lat(), pt1.lon(), left_hdg,
|
||||
-36 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
pt1 = Point3D( lon, lat, 0.0 );
|
||||
r_lights.push_back( pt1 );
|
||||
r_normals.push_back( normal );
|
||||
|
||||
geo_direct_wgs_84 ( alt_m, pt1.lat(), pt1.lon(), left_hdg,
|
||||
-5 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
pt1 = Point3D( lon, lat, 0.0 );
|
||||
r_lights.push_back( pt1 );
|
||||
r_normals.push_back( normal );
|
||||
|
||||
geo_direct_wgs_84 ( alt_m, pt1.lat(), pt1.lon(), left_hdg,
|
||||
-5 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
pt1 = Point3D( lon, lat, 0.0 );
|
||||
r_lights.push_back( pt1 );
|
||||
r_normals.push_back( normal );
|
||||
}
|
||||
}
|
||||
|
||||
pt1 = ref;
|
||||
if ( kind == 1 ) {
|
||||
// Generate pre-threshold bar
|
||||
|
||||
// left 4 side lights
|
||||
geo_direct_wgs_84 ( alt_m, pt1.lat(), pt1.lon(), left_hdg,
|
||||
-11.5 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
pt1 = Point3D( lon, lat, 0.0 );
|
||||
w_lights.push_back( pt1 );
|
||||
w_normals.push_back( normal );
|
||||
ref = ref_save;
|
||||
|
||||
for ( j = 0; j < 3; ++j ) {
|
||||
// offset 100' downwind
|
||||
geo_direct_wgs_84 ( alt_m, ref.lat(), ref.lon(), length_hdg,
|
||||
-100 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
ref = Point3D( lon, lat, 0.0 );
|
||||
|
||||
pt1 = ref;
|
||||
|
||||
// left 5 side lights
|
||||
geo_direct_wgs_84 ( alt_m, pt1.lat(), pt1.lon(), left_hdg,
|
||||
-5 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
75 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
pt1 = Point3D( lon, lat, 0.0 );
|
||||
r_lights.push_back( pt1 );
|
||||
r_normals.push_back( normal );
|
||||
|
||||
for ( j = 0; j < 4; ++j ) {
|
||||
geo_direct_wgs_84 ( alt_m, pt1.lat(), pt1.lon(), left_hdg,
|
||||
3.5 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
pt1 = Point3D( lon, lat, 0.0 );
|
||||
r_lights.push_back( pt1 );
|
||||
r_normals.push_back( normal );
|
||||
}
|
||||
|
||||
pt1 = ref;
|
||||
|
||||
// rioght 5 side lights
|
||||
geo_direct_wgs_84 ( alt_m, pt1.lat(), pt1.lon(), left_hdg,
|
||||
-75 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
pt1 = Point3D( lon, lat, 0.0 );
|
||||
r_lights.push_back( pt1 );
|
||||
r_normals.push_back( normal );
|
||||
|
||||
for ( j = 0; j < 4; ++j ) {
|
||||
geo_direct_wgs_84 ( alt_m, pt1.lat(), pt1.lon(), left_hdg,
|
||||
-3.5 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
pt1 = Point3D( lon, lat, 0.0 );
|
||||
r_lights.push_back( pt1 );
|
||||
r_normals.push_back( normal );
|
||||
}
|
||||
} else if ( kind == 2 ) {
|
||||
// Generate -500 extra horizontal row of lights
|
||||
|
||||
ref = ref_save;
|
||||
|
||||
// offset 500' downwind
|
||||
geo_direct_wgs_84 ( alt_m, ref.lat(), ref.lon(), length_hdg,
|
||||
-500 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
ref = Point3D( lon, lat, 0.0 );
|
||||
|
||||
pt1 = ref;
|
||||
|
||||
// left 4 side lights
|
||||
geo_direct_wgs_84 ( alt_m, pt1.lat(), pt1.lon(), left_hdg,
|
||||
11.5 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
pt1 = Point3D( lon, lat, 0.0 );
|
||||
w_lights.push_back( pt1 );
|
||||
w_normals.push_back( normal );
|
||||
|
||||
for ( j = 0; j < 3; ++j ) {
|
||||
geo_direct_wgs_84 ( alt_m, pt1.lat(), pt1.lon(), left_hdg,
|
||||
5 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
pt1 = Point3D( lon, lat, 0.0 );
|
||||
w_lights.push_back( pt1 );
|
||||
w_normals.push_back( normal );
|
||||
}
|
||||
|
||||
pt1 = ref;
|
||||
|
||||
// right 4 side lights
|
||||
geo_direct_wgs_84 ( alt_m, pt1.lat(), pt1.lon(), left_hdg,
|
||||
-11.5 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
pt1 = Point3D( lon, lat, 0.0 );
|
||||
w_lights.push_back( pt1 );
|
||||
w_normals.push_back( normal );
|
||||
|
||||
for ( j = 0; j < 3; ++j ) {
|
||||
geo_direct_wgs_84 ( alt_m, pt1.lat(), pt1.lon(), left_hdg,
|
||||
-5 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
pt1 = Point3D( lon, lat, 0.0 );
|
||||
w_lights.push_back( pt1 );
|
||||
w_normals.push_back( normal );
|
||||
}
|
||||
}
|
||||
|
||||
// Generate -1000' extra horizontal row of lights
|
||||
|
@ -1492,6 +1588,269 @@ static superpoly_list gen_ssalx( const FGRunway& rwy_info,
|
|||
}
|
||||
|
||||
|
||||
// generate MALS, MALSF, and MALSR approach lighting scheme (kind =
|
||||
// ' ', F, or R)
|
||||
static superpoly_list gen_malsx( const FGRunway& rwy_info,
|
||||
float alt_m, const string& kind, bool recip )
|
||||
{
|
||||
point_list g_lights; g_lights.clear();
|
||||
point_list w_lights; w_lights.clear();
|
||||
point_list r_lights; r_lights.clear();
|
||||
point_list s_lights; s_lights.clear();
|
||||
point_list g_normals; g_normals.clear();
|
||||
point_list w_normals; w_normals.clear();
|
||||
point_list r_normals; r_normals.clear();
|
||||
point_list s_normals; s_normals.clear();
|
||||
int i, j;
|
||||
|
||||
cout << "gen SSALx lights " << rwy_info.rwy_no << endl;
|
||||
|
||||
Point3D normal = gen_runway_light_vector( rwy_info, 3.0, recip );
|
||||
|
||||
// Generate the threshold lights
|
||||
|
||||
double len = rwy_info.length * SG_FEET_TO_METER;
|
||||
int divs = (int)(len / 10.0) + 1;
|
||||
|
||||
// using FGPolygon is a bit innefficient, but that's what the
|
||||
// routine returns.
|
||||
FGPolygon poly_corners = gen_runway_area_w_expand( rwy_info, 2.0, 2.0 );
|
||||
|
||||
point_list corner;
|
||||
for ( i = 0; i < poly_corners.contour_size( 0 ); ++i ) {
|
||||
corner.push_back( poly_corners.get_pt( 0, i ) );
|
||||
}
|
||||
|
||||
Point3D inc1, inc2;
|
||||
Point3D pt1, pt2;
|
||||
|
||||
if ( recip ) {
|
||||
inc1 = (corner[0] - corner[1]) / divs;
|
||||
inc2 = (corner[3] - corner[2]) / divs;
|
||||
pt1 = corner[1];
|
||||
pt2 = corner[2];
|
||||
} else {
|
||||
inc1 = (corner[2] - corner[3]) / divs;
|
||||
inc2 = (corner[1] - corner[0]) / divs;
|
||||
pt1 = corner[3];
|
||||
pt2 = corner[0];
|
||||
}
|
||||
|
||||
double dist = rwy_info.length;
|
||||
double step = dist / divs;
|
||||
|
||||
g_lights.push_back( pt1 );
|
||||
g_normals.push_back( normal );
|
||||
r_lights.push_back( pt2 );
|
||||
r_normals.push_back( normal );
|
||||
dist -= step;
|
||||
|
||||
for ( i = 0; i < divs; ++i ) {
|
||||
pt1 += inc1;
|
||||
pt2 += inc2;
|
||||
g_lights.push_back( pt1 );
|
||||
g_normals.push_back( normal );
|
||||
r_lights.push_back( pt2 );
|
||||
r_normals.push_back( normal );
|
||||
dist -= step;
|
||||
}
|
||||
|
||||
// Generate long center bar of lights (every 200')
|
||||
|
||||
// determine the start point.
|
||||
Point3D ref_save;
|
||||
double length_hdg, left_hdg;
|
||||
double lon, lat, r;
|
||||
if ( recip ) {
|
||||
ref_save = (corner[0] + corner[1]) / 2;
|
||||
length_hdg = rwy_info.heading + 180.0;
|
||||
if ( length_hdg > 360.0 ) { length_hdg -= 360.0; }
|
||||
} else {
|
||||
ref_save = (corner[2] + corner[3]) / 2;
|
||||
length_hdg = rwy_info.heading;
|
||||
}
|
||||
left_hdg = length_hdg - 90.0;
|
||||
if ( left_hdg < 0 ) { left_hdg += 360.0; }
|
||||
cout << "length hdg = " << length_hdg
|
||||
<< " left heading = " << left_hdg << endl;
|
||||
|
||||
Point3D ref = ref_save;
|
||||
|
||||
for ( i = 0; i < 7; ++i ) {
|
||||
// offset 200' downwind
|
||||
geo_direct_wgs_84 ( alt_m, ref.lat(), ref.lon(), length_hdg,
|
||||
-200 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
ref = Point3D( lon, lat, 0.0 );
|
||||
|
||||
pt1 = ref;
|
||||
w_lights.push_back( pt1 );
|
||||
w_normals.push_back( normal );
|
||||
|
||||
// left 2 side lights
|
||||
geo_direct_wgs_84 ( alt_m, pt1.lat(), pt1.lon(), left_hdg,
|
||||
2.5 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
pt1 = Point3D( lon, lat, 0.0 );
|
||||
w_lights.push_back( pt1 );
|
||||
w_normals.push_back( normal );
|
||||
|
||||
geo_direct_wgs_84 ( alt_m, pt1.lat(), pt1.lon(), left_hdg,
|
||||
2.5 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
pt1 = Point3D( lon, lat, 0.0 );
|
||||
w_lights.push_back( pt1 );
|
||||
w_normals.push_back( normal );
|
||||
|
||||
pt1 = ref;
|
||||
|
||||
// right 2 side lights
|
||||
geo_direct_wgs_84 ( alt_m, pt1.lat(), pt1.lon(), left_hdg,
|
||||
-2.5 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
pt1 = Point3D( lon, lat, 0.0 );
|
||||
w_lights.push_back( pt1 );
|
||||
w_normals.push_back( normal );
|
||||
|
||||
geo_direct_wgs_84 ( alt_m, pt1.lat(), pt1.lon(), left_hdg,
|
||||
-2.5 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
pt1 = Point3D( lon, lat, 0.0 );
|
||||
w_lights.push_back( pt1 );
|
||||
w_normals.push_back( normal );
|
||||
}
|
||||
|
||||
// Generate -1000' extra horizontal row of lights
|
||||
|
||||
ref = ref_save;
|
||||
|
||||
// offset 1000' downwind
|
||||
geo_direct_wgs_84 ( alt_m, ref.lat(), ref.lon(), length_hdg,
|
||||
-1000 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
ref = Point3D( lon, lat, 0.0 );
|
||||
|
||||
pt1 = ref;
|
||||
|
||||
// left 5 side lights
|
||||
geo_direct_wgs_84 ( alt_m, pt1.lat(), pt1.lon(), left_hdg,
|
||||
23 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
pt1 = Point3D( lon, lat, 0.0 );
|
||||
w_lights.push_back( pt1 );
|
||||
w_normals.push_back( normal );
|
||||
|
||||
for ( j = 0; j < 4; ++j ) {
|
||||
geo_direct_wgs_84 ( alt_m, pt1.lat(), pt1.lon(), left_hdg,
|
||||
2.5 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
pt1 = Point3D( lon, lat, 0.0 );
|
||||
w_lights.push_back( pt1 );
|
||||
w_normals.push_back( normal );
|
||||
}
|
||||
|
||||
pt1 = ref;
|
||||
|
||||
// right 5 side lights
|
||||
geo_direct_wgs_84 ( alt_m, pt1.lat(), pt1.lon(), left_hdg,
|
||||
-23 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
pt1 = Point3D( lon, lat, 0.0 );
|
||||
w_lights.push_back( pt1 );
|
||||
w_normals.push_back( normal );
|
||||
|
||||
for ( j = 0; j < 4; ++j ) {
|
||||
geo_direct_wgs_84 ( alt_m, pt1.lat(), pt1.lon(), left_hdg,
|
||||
-2.5 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
pt1 = Point3D( lon, lat, 0.0 );
|
||||
w_lights.push_back( pt1 );
|
||||
w_normals.push_back( normal );
|
||||
}
|
||||
|
||||
if ( kind == "R" ) {
|
||||
// generate 5 rabbit lights
|
||||
|
||||
ref = ref_save;
|
||||
|
||||
// start 1600' downwind
|
||||
geo_direct_wgs_84 ( alt_m, ref.lat(), ref.lon(), length_hdg,
|
||||
-1600 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
ref = Point3D( lon, lat, 0.0 );
|
||||
|
||||
for ( i = 0; i < 8; ++i ) {
|
||||
s_lights.push_back( ref );
|
||||
s_normals.push_back( normal );
|
||||
|
||||
// offset 200' downwind
|
||||
geo_direct_wgs_84 ( alt_m, ref.lat(), ref.lon(), length_hdg,
|
||||
-200 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
ref = Point3D( lon, lat, 0.0 );
|
||||
}
|
||||
} else if ( kind == "F" ) {
|
||||
// generate 3 sequenced lights aligned with last 3 light bars
|
||||
ref = ref_save;
|
||||
|
||||
// start 1010' downwind
|
||||
geo_direct_wgs_84 ( alt_m, ref.lat(), ref.lon(), length_hdg,
|
||||
-1010 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
ref = Point3D( lon, lat, 0.0 );
|
||||
|
||||
for ( i = 0; i < 3; ++i ) {
|
||||
s_lights.push_back( ref );
|
||||
s_normals.push_back( normal );
|
||||
|
||||
// offset 200' downwind
|
||||
geo_direct_wgs_84 ( alt_m, ref.lat(), ref.lon(), length_hdg,
|
||||
-200 * SG_FEET_TO_METER, &lat, &lon, &r );
|
||||
ref = Point3D( lon, lat, 0.0 );
|
||||
}
|
||||
}
|
||||
|
||||
FGPolygon lights_poly; lights_poly.erase();
|
||||
FGPolygon normals_poly; normals_poly.erase();
|
||||
lights_poly.add_contour( g_lights, false );
|
||||
normals_poly.add_contour( g_normals, false );
|
||||
|
||||
FGSuperPoly green;
|
||||
green.set_poly( lights_poly );
|
||||
green.set_normals( normals_poly );
|
||||
green.set_material( "RWY_GREEN_LIGHTS" );
|
||||
|
||||
lights_poly.erase();
|
||||
normals_poly.erase();
|
||||
lights_poly.add_contour( r_lights, false );
|
||||
normals_poly.add_contour( r_normals, false );
|
||||
|
||||
FGSuperPoly red;
|
||||
red.set_poly( lights_poly );
|
||||
red.set_normals( normals_poly );
|
||||
red.set_material( "RWY_RED_LIGHTS" );
|
||||
|
||||
lights_poly.erase();
|
||||
normals_poly.erase();
|
||||
lights_poly.add_contour( w_lights, false );
|
||||
normals_poly.add_contour( w_normals, false );
|
||||
|
||||
FGSuperPoly white;
|
||||
white.set_poly( lights_poly );
|
||||
white.set_normals( normals_poly );
|
||||
white.set_material( "RWY_WHITE_LIGHTS" );
|
||||
|
||||
superpoly_list result; result.clear();
|
||||
|
||||
result.push_back( green );
|
||||
result.push_back( red );
|
||||
result.push_back( white );
|
||||
|
||||
if ( s_lights.size() > 0 ) {
|
||||
lights_poly.erase();
|
||||
normals_poly.erase();
|
||||
lights_poly.add_contour( s_lights, false );
|
||||
normals_poly.add_contour( s_normals, false );
|
||||
|
||||
FGSuperPoly sequenced;
|
||||
sequenced.set_poly( lights_poly );
|
||||
sequenced.set_normals( normals_poly );
|
||||
sequenced.set_material( "RWY_SEQUENCED_LIGHTS" );
|
||||
|
||||
result.push_back( sequenced );
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
// top level runway light generator
|
||||
void gen_runway_lights( const FGRunway& rwy_info, float alt_m,
|
||||
superpoly_list &lights ) {
|
||||
|
@ -1576,15 +1935,71 @@ void gen_runway_lights( const FGRunway& rwy_info, float alt_m,
|
|||
|
||||
// Approach lighting
|
||||
|
||||
// ALSF-I
|
||||
if ( rwy_info.end1_flags.substr(3,1) == "B" ) {
|
||||
superpoly_list s = gen_alsf( rwy_info, alt_m, 1, false );
|
||||
for ( i = 0; i < s.size(); ++i ) {
|
||||
lights.push_back( s[i] );
|
||||
}
|
||||
}
|
||||
if ( rwy_info.end2_flags.substr(3,1) == "B" ) {
|
||||
superpoly_list s = gen_alsf( rwy_info, alt_m, 1, true );
|
||||
for ( i = 0; i < s.size(); ++i ) {
|
||||
lights.push_back( s[i] );
|
||||
}
|
||||
}
|
||||
|
||||
// ALSF-II
|
||||
if ( rwy_info.end1_flags.substr(3,1) == "C" ) {
|
||||
superpoly_list s = gen_alsf_ii( rwy_info, alt_m, false );
|
||||
superpoly_list s = gen_alsf( rwy_info, alt_m, 2, false );
|
||||
for ( i = 0; i < s.size(); ++i ) {
|
||||
lights.push_back( s[i] );
|
||||
}
|
||||
}
|
||||
if ( rwy_info.end2_flags.substr(3,1) == "C" ) {
|
||||
superpoly_list s = gen_alsf_ii( rwy_info, alt_m, true );
|
||||
superpoly_list s = gen_alsf( rwy_info, alt_m, 2, true );
|
||||
for ( i = 0; i < s.size(); ++i ) {
|
||||
lights.push_back( s[i] );
|
||||
}
|
||||
}
|
||||
|
||||
// MALS
|
||||
if ( rwy_info.end1_flags.substr(3,1) == "G" ) {
|
||||
superpoly_list s = gen_malsx( rwy_info, alt_m, "x", false );
|
||||
for ( i = 0; i < s.size(); ++i ) {
|
||||
lights.push_back( s[i] );
|
||||
}
|
||||
}
|
||||
if ( rwy_info.end2_flags.substr(3,1) == "G" ) {
|
||||
superpoly_list s = gen_malsx( rwy_info, alt_m, "x", true );
|
||||
for ( i = 0; i < s.size(); ++i ) {
|
||||
lights.push_back( s[i] );
|
||||
}
|
||||
}
|
||||
|
||||
// MALSF
|
||||
if ( rwy_info.end1_flags.substr(3,1) == "H" ) {
|
||||
superpoly_list s = gen_malsx( rwy_info, alt_m, "F", false );
|
||||
for ( i = 0; i < s.size(); ++i ) {
|
||||
lights.push_back( s[i] );
|
||||
}
|
||||
}
|
||||
if ( rwy_info.end2_flags.substr(3,1) == "H" ) {
|
||||
superpoly_list s = gen_malsx( rwy_info, alt_m, "F", true );
|
||||
for ( i = 0; i < s.size(); ++i ) {
|
||||
lights.push_back( s[i] );
|
||||
}
|
||||
}
|
||||
|
||||
// MALSR
|
||||
if ( rwy_info.end1_flags.substr(3,1) == "J" ) {
|
||||
superpoly_list s = gen_malsx( rwy_info, alt_m, "R", false );
|
||||
for ( i = 0; i < s.size(); ++i ) {
|
||||
lights.push_back( s[i] );
|
||||
}
|
||||
}
|
||||
if ( rwy_info.end2_flags.substr(3,1) == "J" ) {
|
||||
superpoly_list s = gen_malsx( rwy_info, alt_m, "R", true );
|
||||
for ( i = 0; i < s.size(); ++i ) {
|
||||
lights.push_back( s[i] );
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue