diff --git a/src/Airports/GenAirports/build.cxx b/src/Airports/GenAirports/build.cxx index c29246b2..3e693d81 100644 --- a/src/Airports/GenAirports/build.cxx +++ b/src/Airports/GenAirports/build.cxx @@ -886,8 +886,11 @@ void build_airport( string airport_raw, string_list& runways_raw, strip_v.push_back( uindex ); strip_v.push_back( lindex ); + // use 'the' normal. We are pushing on two nodes so we + // need to push on two normals. index = normals.unique_add( vn ); strip_n.push_back( index ); + strip_n.push_back( index ); } else { cout << "Ooops missing node when building skirt ... dying!" << endl; @@ -908,6 +911,7 @@ void build_airport( string airport_raw, string_list& runways_raw, index = normals.unique_add( vn ); strip_n.push_back( index ); + strip_n.push_back( index ); } else { cout << "Ooops missing node when building skirt ... dying!" << endl; @@ -928,6 +932,7 @@ void build_airport( string airport_raw, string_list& runways_raw, index = normals.unique_add( vn ); strip_n.push_back( index ); + strip_n.push_back( index ); } else { cout << "Ooops missing node when building skirt ... dying!" << endl; @@ -977,7 +982,7 @@ void build_airport( string airport_raw, string_list& runways_raw, pt_v.push_back( index ); geod_nodes.push_back( p ); - index = normals.simple_add( rwy_light_normals[i] ); + index = normals.unique_add( rwy_light_normals[i] ); pt_n.push_back( index ); } pts_v.push_back( pt_v ); diff --git a/src/Airports/GenAirports/lights.cxx b/src/Airports/GenAirports/lights.cxx index 4faed458..50312715 100644 --- a/src/Airports/GenAirports/lights.cxx +++ b/src/Airports/GenAirports/lights.cxx @@ -52,7 +52,8 @@ Point3D gen_runway_light_vector( const FGRunway& rwy_info ) { // FIXME // need to angle up (i.e. 3 degrees) - return rwy_vec; + double length = rwy_vec.distance3D( Point3D(0.0) ); + return rwy_vec / length; } @@ -62,6 +63,8 @@ void gen_runway_lights( const FGRunway& rwy_info, point_list *lights, point_list *normals ) { int i; + Point3D normal = gen_runway_light_vector( rwy_info ); + // using FGPolygon is a bit innefficient, but that's what the // routine returns. FGPolygon poly_corners = gen_runway_area_w_expand( rwy_info, 0.0, 0.0 ); @@ -77,13 +80,17 @@ void gen_runway_lights( const FGRunway& rwy_info, Point3D pt1 = corner[0]; Point3D pt2 = corner[1]; lights->push_back( pt1 ); + normals->push_back( normal ); lights->push_back( pt2 ); + normals->push_back( normal ); for ( i = 0; i < FG_DIVS; ++i ) { pt1 += inc1; pt2 += inc2; lights->push_back( pt1 ); + normals->push_back( normal ); lights->push_back( pt2 ); + normals->push_back( normal ); } }