]> git.mxchange.org Git - flightgear.git/commitdiff
Update FGRunway to process information from threshold.xml files.
authorjmt <jmt>
Sat, 29 Aug 2009 18:26:54 +0000 (18:26 +0000)
committerTim Moore <timoore@redhat.com>
Wed, 2 Sep 2009 22:02:47 +0000 (00:02 +0200)
src/Airports/runways.cxx
src/Airports/xmlloader.cxx

index c3686bcaca481d9763759b40394628c81e24ee3b..f97cd14e83aee82c4c4dde7e078d2a77362ba50d 100644 (file)
@@ -31,6 +31,7 @@
 #include <simgear/compiler.h>
 
 #include <simgear/props/props.hxx>
+
 #include <string>
 
 #include "runways.hxx"
@@ -140,4 +141,20 @@ SGGeod FGRunway::threshold() const
 void FGRunway::processThreshold(SGPropertyNode* aThreshold)
 {
   assert(ident() == aThreshold->getStringValue("rwy"));
-}
+  
+  double lon = aThreshold->getDoubleValue("lon"),
+    lat = aThreshold->getDoubleValue("lat");
+  SGGeod newThreshold(SGGeod::fromDegM(lon, lat, mPosition.getElevationM()));
+  
+  _heading = aThreshold->getDoubleValue("hdg-deg");
+  _displ_thresh = aThreshold->getDoubleValue("displ-m") * SG_METER_TO_FEET;
+  _stopway = aThreshold->getDoubleValue("stopw-m") * SG_METER_TO_FEET;
+  
+  // compute the new runway center, based on the threshold lat/lon, length,
+  // and any displaced threshold.
+  double offsetFt = (0.5 * _length) - _displ_thresh;
+  SGGeod newCenter;
+  double dummy;
+  SGGeodesy::direct(newThreshold, _heading, offsetFt * SG_FEET_TO_METER, newCenter, dummy);
+  mPosition = newCenter;
+} 
index f6e351823d52bfba082f211bdca8018b65d50aaf..58539a1f2ccac87f4f759b1207ed05cc1395b68b 100644 (file)
@@ -97,7 +97,6 @@ bool XMLLoader::findAirportData(const std::string& aICAO,
       return true;
     } // of path exists
   } // of scenery path iteration
-
   return false;
 }