From 14faf5136a529576b7a6f51505a5d0a67f9713fa Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Thu, 19 Jul 2018 02:38:59 +0200 Subject: [PATCH] Ref T268, XPlane testing showed: height has an influence on the returned elevation result * the most accurate value seems to be returned if the height is close to the elevation * in normal scenarios there is no much difference of the results if 0 is used * in Lukla (9200ft MSL) the difference between 0 and 9200 is around 1ft * in the LOWW scenario using 50000ft MSL results in around 3ft too low elevation --- src/plugins/simulator/xplane/simulatorxplane.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/plugins/simulator/xplane/simulatorxplane.cpp b/src/plugins/simulator/xplane/simulatorxplane.cpp index bf0b825fb..807d87b9a 100644 --- a/src/plugins/simulator/xplane/simulatorxplane.cpp +++ b/src/plugins/simulator/xplane/simulatorxplane.cpp @@ -154,9 +154,17 @@ namespace BlackSimPlugin if (this->isShuttingDown()) { return false; } if (reference.isNull()) { return false; } - static const CAltitude alt(50000, CLengthUnit::ft()); CCoordinateGeodetic pos(reference); - pos.setGeodeticHeight(alt); + if (!pos.hasMSLGeodeticHeight()) + { + // testing showed: height has an influence on the returned result + // - the most accurate value seems to be returned if the height is close to the elevation + // - in normal scenarios there is no much difference of the results if 0 is used + // - in Lukla (9200ft MSL) the difference between 0 and 9200 is around 1ft + // - in the LOWW scenario using 50000ft MSL results in around 3ft too low elevation + static const CAltitude alt(0, CAltitude::MeanSeaLevel, CLengthUnit::ft()); + pos.setGeodeticHeight(alt); + } using namespace std::placeholders; auto callback = std::bind(&CSimulatorXPlane::callbackReceivedRequestedElevation, this, _1, _2);