Correctly position the PAPI lights around the center and enable
left/right-handed PAPI versions
This commit is contained in:
parent
b583e8d0f0
commit
18b2c8a51a
1 changed files with 65 additions and 27 deletions
|
@ -14,17 +14,15 @@ void LightingObj::BuildBtg( int alt_m, superpoly_list* lights )
|
||||||
point_list lightobj; lightobj.clear();
|
point_list lightobj; lightobj.clear();
|
||||||
point_list normals; normals.clear();
|
point_list normals; normals.clear();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Point3D ref;
|
Point3D ref;
|
||||||
double lon2 = 0, lat2 = 0, r;
|
double lon2 = 0, lat2 = 0, r;
|
||||||
|
|
||||||
double left_hdg = heading - 90.0;
|
double left_hdg = heading - 90.0;
|
||||||
|
if ( left_hdg < 0 ) { left_hdg += 360.0; }
|
||||||
|
|
||||||
ref.setlat( lat );
|
ref.setlat( lat );
|
||||||
ref.setlon( lon );
|
ref.setlon( lon );
|
||||||
|
|
||||||
if ( left_hdg < 0 ) { left_hdg += 360.0; }
|
|
||||||
|
|
||||||
if ( glideslope < 0.5 ) {
|
if ( glideslope < 0.5 ) {
|
||||||
glideslope = 3.0;
|
glideslope = 3.0;
|
||||||
}
|
}
|
||||||
|
@ -65,33 +63,73 @@ void LightingObj::BuildBtg( int alt_m, superpoly_list* lights )
|
||||||
|
|
||||||
|
|
||||||
// We know our normal, now create the lights
|
// We know our normal, now create the lights
|
||||||
SG_LOG(SG_GENERAL, SG_DEBUG, "Generating PAPI = " << assoc_rw);
|
Point3D pt1;
|
||||||
|
|
||||||
// unit1
|
if (type == 2)
|
||||||
Point3D pt1 = ref;
|
{
|
||||||
lightobj.push_back( pt1 );
|
SG_LOG(SG_GENERAL, SG_DEBUG, "Generating PAPI 4L = " << assoc_rw);
|
||||||
normals.push_back( normal );
|
|
||||||
|
|
||||||
// unit2
|
// unit1
|
||||||
geo_direct_wgs_84 ( alt_m, pt1.lat(), pt1.lon(), left_hdg,
|
geo_direct_wgs_84 ( alt_m, ref.lat(), ref.lon(), left_hdg,
|
||||||
30 * SG_FEET_TO_METER, &lat2, &lon2, &r );
|
-45 * SG_FEET_TO_METER, &lat2, &lon2, &r );
|
||||||
pt1 = Point3D( lon2, lat2, 0.0 );
|
pt1 = Point3D( lon2, lat2, 0.0 );
|
||||||
lightobj.push_back( pt1 );
|
lightobj.push_back( pt1 );
|
||||||
normals.push_back( normal );
|
normals.push_back( normal );
|
||||||
|
|
||||||
// unit3
|
// unit2
|
||||||
geo_direct_wgs_84 ( alt_m, pt1.lat(), pt1.lon(), left_hdg,
|
geo_direct_wgs_84 ( alt_m, pt1.lat(), pt1.lon(), left_hdg,
|
||||||
30 * SG_FEET_TO_METER, &lat2, &lon2, &r );
|
30 * SG_FEET_TO_METER, &lat2, &lon2, &r );
|
||||||
pt1 = Point3D( lon2, lat2, 0.0 );
|
pt1 = Point3D( lon2, lat2, 0.0 );
|
||||||
lightobj.push_back( pt1 );
|
lightobj.push_back( pt1 );
|
||||||
normals.push_back( normal );
|
normals.push_back( normal );
|
||||||
|
|
||||||
// unit4
|
// unit3
|
||||||
geo_direct_wgs_84 ( alt_m, pt1.lat(), pt1.lon(), left_hdg,
|
geo_direct_wgs_84 ( alt_m, pt1.lat(), pt1.lon(), left_hdg,
|
||||||
30 * SG_FEET_TO_METER, &lat2, &lon2, &r );
|
30 * SG_FEET_TO_METER, &lat2, &lon2, &r );
|
||||||
pt1 = Point3D( lon2, lat2, 0.0 );
|
pt1 = Point3D( lon2, lat2, 0.0 );
|
||||||
lightobj.push_back( pt1 );
|
lightobj.push_back( pt1 );
|
||||||
normals.push_back( normal );
|
normals.push_back( normal );
|
||||||
|
|
||||||
|
// unit4
|
||||||
|
geo_direct_wgs_84 ( alt_m, pt1.lat(), pt1.lon(), left_hdg,
|
||||||
|
30 * SG_FEET_TO_METER, &lat2, &lon2, &r );
|
||||||
|
pt1 = Point3D( lon2, lat2, 0.0 );
|
||||||
|
lightobj.push_back( pt1 );
|
||||||
|
normals.push_back( normal );
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type == 3)
|
||||||
|
{
|
||||||
|
SG_LOG(SG_GENERAL, SG_DEBUG, "Generating PAPI 4R = " << assoc_rw);
|
||||||
|
|
||||||
|
// unit1
|
||||||
|
geo_direct_wgs_84 ( alt_m, ref.lat(), ref.lon(), left_hdg,
|
||||||
|
45 * SG_FEET_TO_METER, &lat2, &lon2, &r );
|
||||||
|
pt1 = Point3D( lon2, lat2, 0.0 );
|
||||||
|
lightobj.push_back( pt1 );
|
||||||
|
normals.push_back( normal );
|
||||||
|
|
||||||
|
// unit2
|
||||||
|
geo_direct_wgs_84 ( alt_m, pt1.lat(), pt1.lon(), left_hdg,
|
||||||
|
-30 * SG_FEET_TO_METER, &lat2, &lon2, &r );
|
||||||
|
pt1 = Point3D( lon2, lat2, 0.0 );
|
||||||
|
lightobj.push_back( pt1 );
|
||||||
|
normals.push_back( normal );
|
||||||
|
|
||||||
|
// unit3
|
||||||
|
geo_direct_wgs_84 ( alt_m, pt1.lat(), pt1.lon(), left_hdg,
|
||||||
|
-30 * SG_FEET_TO_METER, &lat2, &lon2, &r );
|
||||||
|
pt1 = Point3D( lon2, lat2, 0.0 );
|
||||||
|
lightobj.push_back( pt1 );
|
||||||
|
normals.push_back( normal );
|
||||||
|
|
||||||
|
// unit4
|
||||||
|
geo_direct_wgs_84 ( alt_m, pt1.lat(), pt1.lon(), left_hdg,
|
||||||
|
-30 * SG_FEET_TO_METER, &lat2, &lon2, &r );
|
||||||
|
pt1 = Point3D( lon2, lat2, 0.0 );
|
||||||
|
lightobj.push_back( pt1 );
|
||||||
|
normals.push_back( normal );
|
||||||
|
}
|
||||||
|
|
||||||
TGPolygon lights_poly; lights_poly.erase();
|
TGPolygon lights_poly; lights_poly.erase();
|
||||||
TGPolygon normals_poly; normals_poly.erase();
|
TGPolygon normals_poly; normals_poly.erase();
|
||||||
|
|
Loading…
Add table
Reference in a new issue