From 2dee4ef14ff449381d11ef2d55d07b2e199677af Mon Sep 17 00:00:00 2001 From: jmt Date: Sat, 29 Aug 2009 18:26:54 +0000 Subject: [PATCH] Update FGRunway to process information from threshold.xml files. --- src/Airports/runways.cxx | 19 ++++++++++++++++++- src/Airports/xmlloader.cxx | 1 - 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/Airports/runways.cxx b/src/Airports/runways.cxx index c3686bcac..f97cd14e8 100644 --- a/src/Airports/runways.cxx +++ b/src/Airports/runways.cxx @@ -31,6 +31,7 @@ #include #include + #include #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; +} diff --git a/src/Airports/xmlloader.cxx b/src/Airports/xmlloader.cxx index f6e351823..58539a1f2 100644 --- a/src/Airports/xmlloader.cxx +++ b/src/Airports/xmlloader.cxx @@ -97,7 +97,6 @@ bool XMLLoader::findAirportData(const std::string& aICAO, return true; } // of path exists } // of scenery path iteration - return false; } -- 2.39.5