mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 21:56:43 +08:00
refs #865, hints get ground elevation from provider or from set value
* using CAltitude for elevation provider * null() for CAltitude * formatting of members * fixme in fs9 client
This commit is contained in:
committed by
Mathew Sutcliffe
parent
0a99c82ddc
commit
38585d10b2
@@ -50,12 +50,14 @@ namespace XBus
|
||||
hints.setElevationProvider([this](const auto &situation)
|
||||
{
|
||||
using namespace BlackMisc::PhysicalQuantities;
|
||||
const auto meters = terrainProbe.getElevation(situation.latitude().value(CAngleUnit::deg()),
|
||||
situation.longitude().value(CAngleUnit::deg()),
|
||||
situation.getAltitude().value(CLengthUnit::m()));
|
||||
if (std::isnan(meters)) { return CLength(0, nullptr); }
|
||||
using namespace BlackMisc::Aviation;
|
||||
const auto meters = terrainProbe.getElevation(
|
||||
situation.latitude().value(CAngleUnit::deg()),
|
||||
situation.longitude().value(CAngleUnit::deg()),
|
||||
situation.getAltitude().value(CLengthUnit::m()));
|
||||
if (std::isnan(meters)) { return CAltitude::null(); }
|
||||
constexpr decltype(meters) fudgeFactor = 3.0; //! \fixme Value should be different for each plane, derived from the CSL model geometry
|
||||
return CLength(meters + fudgeFactor, CLengthUnit::m());
|
||||
return CAltitude(CLength(meters + fudgeFactor, CLengthUnit::m()), CAltitude::MeanSeaLevel);
|
||||
});
|
||||
return hints;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user