Add edge lights to old 810-type taxiways
This commit is contained in:
parent
b013ad6b7b
commit
05091265a5
3 changed files with 38 additions and 77 deletions
|
@ -295,75 +295,6 @@ tglightcontour_list Runway::gen_runway_center_line_lights( bool recip )
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
// generate taxiway center line lighting, 50' spacing.
|
|
||||||
static superpoly_list gen_taxiway_center_line_lights( bool recip )
|
|
||||||
{
|
|
||||||
point_list g_lights; g_lights.clear();
|
|
||||||
point_list g_normals; g_normals.clear();
|
|
||||||
int i;
|
|
||||||
|
|
||||||
double len = rwy.length;
|
|
||||||
// this should be ??' technically but I'm trying 50' to space things out
|
|
||||||
int divs = (int)(len / 70) + 1;
|
|
||||||
|
|
||||||
Point3D normal = gen_runway_light_vector( 3.0, recip );
|
|
||||||
|
|
||||||
// using TGPolygon is a bit innefficient, but that's what the
|
|
||||||
// routine returns.
|
|
||||||
TGPolygon poly_corners = gen_runway_area_w_extend( 2.0, 0.0, 0.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 inc;
|
|
||||||
Point3D pt1, pt2;
|
|
||||||
|
|
||||||
if ( recip ) {
|
|
||||||
pt1 = (corner[0] + corner[1] ) / 2.0;
|
|
||||||
pt2 = (corner[2] + corner[3] ) / 2.0;
|
|
||||||
} else {
|
|
||||||
pt1 = (corner[2] + corner[3] ) / 2.0;
|
|
||||||
pt2 = (corner[0] + corner[1] ) / 2.0;
|
|
||||||
}
|
|
||||||
inc = (pt2 - pt1) / divs;
|
|
||||||
|
|
||||||
double dist = len;
|
|
||||||
double step = len / divs;
|
|
||||||
pt1 += inc; // move 25' in
|
|
||||||
dist -= step;
|
|
||||||
|
|
||||||
while ( dist > 0.0 ) {
|
|
||||||
g_lights.push_back( pt1 );
|
|
||||||
g_normals.push_back( normal );
|
|
||||||
|
|
||||||
pt1 += inc;
|
|
||||||
pt1 += inc;
|
|
||||||
dist -= step;
|
|
||||||
dist -= step;
|
|
||||||
}
|
|
||||||
|
|
||||||
superpoly_list result; result.clear();
|
|
||||||
|
|
||||||
if ( g_lights.size() > 0 ) {
|
|
||||||
TGPolygon lights_poly; lights_poly.erase();
|
|
||||||
TGPolygon normals_poly; normals_poly.erase();
|
|
||||||
lights_poly.add_contour( g_lights, false );
|
|
||||||
normals_poly.add_contour( g_normals, false );
|
|
||||||
|
|
||||||
TGSuperPoly green;
|
|
||||||
green.set_poly( lights_poly );
|
|
||||||
green.set_normals( normals_poly );
|
|
||||||
green.set_material( "RWY_GREEN_TAXIWAY_LIGHTS" );
|
|
||||||
|
|
||||||
result.push_back( green );
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
// generate touch down zone lights
|
// generate touch down zone lights
|
||||||
tgLightContour Runway::gen_touchdown_zone_lights( bool recip )
|
tgLightContour Runway::gen_touchdown_zone_lights( bool recip )
|
||||||
|
|
|
@ -13,7 +13,7 @@ extern int nudge;
|
||||||
|
|
||||||
Taxiway::Taxiway(char* definition)
|
Taxiway::Taxiway(char* definition)
|
||||||
{
|
{
|
||||||
// variables for sdjusting 810 rwy format to 850 rwy format
|
// variables for adjusting 810 rwy format to 850 rwy format
|
||||||
double lon = 0, lat = 0;
|
double lon = 0, lat = 0;
|
||||||
|
|
||||||
// variables to store unused parameters
|
// variables to store unused parameters
|
||||||
|
@ -52,6 +52,33 @@ Taxiway::Taxiway(char* definition)
|
||||||
taxi_contour = gen_wgs84_rect( origin, heading, length, width );
|
taxi_contour = gen_wgs84_rect( origin, heading, length, width );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Taxiway::GenLights(tglightcontour_list& rwy_lights)
|
||||||
|
{
|
||||||
|
// Create blue taxiway edge lights along the long sides of the taxiway
|
||||||
|
// Spacing is 10m
|
||||||
|
|
||||||
|
// Vector calculation
|
||||||
|
SGVec3d vec = normalize(SGVec3d::fromGeod(taxi_contour.GetNode(0)));
|
||||||
|
|
||||||
|
tgLightContour blue;
|
||||||
|
blue.SetType( "RWY_BLUE_TAXIWAY_LIGHTS" );
|
||||||
|
|
||||||
|
for ( unsigned int i = 0; i < taxi_contour.GetSize(); ++i ) {
|
||||||
|
double dist, course, cs;
|
||||||
|
SGGeodesy::inverse(taxi_contour.GetNode(i), taxi_contour.GetNode(i+1), course, cs, dist );
|
||||||
|
int divs = (int)(dist / 10.0);
|
||||||
|
double step = dist/divs;
|
||||||
|
SGGeod pt = taxi_contour.GetNode(i);
|
||||||
|
for (int j = 0; j < divs; ++j) {
|
||||||
|
pt = SGGeodesy::direct(pt, course, step );
|
||||||
|
blue.AddLight( pt, vec );
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
rwy_lights.push_back( blue );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
int Taxiway::BuildBtg( tgpolygon_list& rwy_polys, tglightcontour_list& rwy_lights, tgcontour_list& slivers, std::string& shapefile_name )
|
int Taxiway::BuildBtg( tgpolygon_list& rwy_polys, tglightcontour_list& rwy_lights, tgcontour_list& slivers, std::string& shapefile_name )
|
||||||
{
|
{
|
||||||
std::string material;
|
std::string material;
|
||||||
|
@ -60,6 +87,7 @@ int Taxiway::BuildBtg( tgpolygon_list& rwy_polys, tglightcontour_list& rwy_light
|
||||||
{
|
{
|
||||||
if ( (width <= 50) && (lighting[1] == '6') ) {
|
if ( (width <= 50) && (lighting[1] == '6') ) {
|
||||||
material = "pa_taxiway";
|
material = "pa_taxiway";
|
||||||
|
GenLights(rwy_lights);
|
||||||
} else {
|
} else {
|
||||||
material = "pa_tiedown";
|
material = "pa_tiedown";
|
||||||
}
|
}
|
||||||
|
@ -68,6 +96,7 @@ int Taxiway::BuildBtg( tgpolygon_list& rwy_polys, tglightcontour_list& rwy_light
|
||||||
{
|
{
|
||||||
if ( (width <= 50) && (lighting[1] == '6') ) {
|
if ( (width <= 50) && (lighting[1] == '6') ) {
|
||||||
material = "pc_taxiway";
|
material = "pc_taxiway";
|
||||||
|
GenLights(rwy_lights);
|
||||||
} else {
|
} else {
|
||||||
material = "pc_tiedown";
|
material = "pc_tiedown";
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,9 +34,10 @@ private:
|
||||||
double length;
|
double length;
|
||||||
double width;
|
double width;
|
||||||
int surface;
|
int surface;
|
||||||
char lighting[8];
|
char lighting[6];
|
||||||
|
|
||||||
tgContour taxi_contour;
|
tgContour taxi_contour;
|
||||||
|
void GenLights(tglightcontour_list& rwy_lights);
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::vector <Taxiway *> TaxiwayList;
|
typedef std::vector <Taxiway *> TaxiwayList;
|
||||||
|
|
Loading…
Reference in a new issue