]> git.mxchange.org Git - flightgear.git/commitdiff
Set runway elevation to the airport elevation, and don't reset ILS/LOC elevation...
authorjmt <jmt>
Tue, 8 Sep 2009 11:23:53 +0000 (11:23 +0000)
committerTim Moore <timoore@redhat.com>
Wed, 9 Sep 2009 06:56:31 +0000 (08:56 +0200)
src/Airports/apt_loader.cxx
src/Navaids/navrecord.cxx

index f78198798d74bb8a43ab50c941f571a71db9a525..a8af8ca4792d50e720006081f2985762173b31e1 100644 (file)
@@ -257,7 +257,7 @@ private:
     last_rwy_heading = heading;
 
     int surface_code = atoi( token[10].c_str() );
-    SGGeod pos(SGGeod::fromDegFt(lon, lat, 0.0));
+    SGGeod pos(SGGeod::fromDegFt(lon, lat, last_apt_elev));
     
     if (rwy_no[0] == 'x') {
       // taxiway
index 73edc243f737ee8bb3c6c23f295b6a4d28ca6167..2029d2b7d3e004a2aa10c6b4c0de1432251f6741 100644 (file)
@@ -161,9 +161,7 @@ void FGNavRecord::processSceneryILS(SGPropertyNode* aILSNode)
 void FGNavRecord::alignLocaliserWithRunway(double aThreshold)
 {
 // find the distance from the threshold to the localizer
-  SGGeod runwayThreshold(mRunway->threshold());
-  double dist, az1, az2;
-  SGGeodesy::inverse(mPosition, runwayThreshold, az1, az2, dist);
+  double dist = SGGeodesy::distanceM(mPosition, mRunway->threshold());
 
 // back project that distance along the runway center line
   SGGeod newPos = mRunway->pointOnCenterline(dist);
@@ -172,7 +170,7 @@ void FGNavRecord::alignLocaliserWithRunway(double aThreshold)
   SG_NORMALIZE_RANGE(hdg_diff, -180.0, 180.0);
 
   if ( fabs(hdg_diff) <= aThreshold ) {
-    mPosition = newPos;
+    mPosition = SGGeod::fromGeodFt(newPos, mPosition.getElevationFt());
     set_multiuse( mRunway->headingDeg() );
   } else {
     SG_LOG(SG_GENERAL, SG_WARN, "localizer:" << ident() << ", aligning with runway "