mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 15:25:35 +08:00
Ref T231, set elevation as default for current situation
This commit is contained in:
@@ -64,10 +64,19 @@ namespace BlackMisc
|
||||
if (m_aircraftSituations.isEmpty()) { return {}; }
|
||||
CAircraftSituation currentSituation = m_aircraftSituations.front();
|
||||
|
||||
// Update current position by hints' elevation
|
||||
// * for XP provided by hints.getElevationProvider at current position
|
||||
// * for FSX/P3D provided as hints.getElevation which is set to current position of remote aircraft in simulator
|
||||
// * As XP uses lazy init we will call getGroundElevation only when needed
|
||||
// * default here via getElevationPlane
|
||||
CAltitude currentGroundElevation(hints.getElevationPlane().getAltitudeIfWithinRadius(currentSituation));
|
||||
currentSituation.setGroundElevationChecked(currentGroundElevation); // set as default
|
||||
|
||||
// data, split situations by time
|
||||
if (currentTimeMsSinceEpoc < 0) { currentTimeMsSinceEpoc = QDateTime::currentMSecsSinceEpoch(); }
|
||||
|
||||
// interpolant function from derived class
|
||||
// CInterpolatorLinear::Interpolant or CInterpolatorSpline::Interpolant
|
||||
const auto interpolant = derived()->getInterpolant(currentTimeMsSinceEpoc, setup, hints, status, log);
|
||||
|
||||
// succeeded so far?
|
||||
@@ -93,13 +102,6 @@ namespace BlackMisc
|
||||
}
|
||||
m_isFirstInterpolation = false;
|
||||
|
||||
// Update current position by hints' elevation
|
||||
// * for XP provided by hints.getElevationProvider at current position
|
||||
// * for FSX/P3D provided as hints.getElevation which is set to current position of remote aircraft in simulator
|
||||
// * As XP uses lazy init we will call getGroundElevation only when needed
|
||||
// * default here via getElevationPlane
|
||||
CAltitude currentGroundElevation(hints.getElevationPlane().getAltitudeIfWithinRadius(currentSituation));
|
||||
|
||||
// Interpolate between altitude and ground elevation, with proportions weighted according to interpolated onGround flag
|
||||
if (hints.hasAircraftParts())
|
||||
{
|
||||
@@ -126,7 +128,6 @@ namespace BlackMisc
|
||||
{
|
||||
// guess ground flag
|
||||
constexpr double NoGroundFactor = -1;
|
||||
currentSituation.setGroundElevation(currentGroundElevation);
|
||||
CInterpolator::setGroundFlagFromInterpolator(hints, NoGroundFactor, currentSituation);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user