mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 02:35:33 +08:00
[xplane] Allow disabling terrain probe for diagnosing performance issues
This commit is contained in:
@@ -509,8 +509,12 @@ namespace XSwiftBus
|
||||
|
||||
const double latDeg = plane->position.lat;
|
||||
const double lonDeg = plane->position.lon;
|
||||
double groundElevation = plane->terrainProbe.getElevation(latDeg, lonDeg, plane->position.elevation, requestedCallsign);
|
||||
if (std::isnan(groundElevation)) { groundElevation = 0.0; }
|
||||
double groundElevation = 0.0;
|
||||
if (getSettings().isTerrainProbeEnabled())
|
||||
{
|
||||
groundElevation = plane->terrainProbe.getElevation(latDeg, lonDeg, plane->position.elevation, requestedCallsign);
|
||||
if (std::isnan(groundElevation)) { groundElevation = 0.0; }
|
||||
}
|
||||
double fudgeFactor = 3.0;
|
||||
bool hasOffset = XPMPGetVerticalOffset(plane->id, &fudgeFactor);
|
||||
|
||||
@@ -524,6 +528,8 @@ namespace XSwiftBus
|
||||
|
||||
double CTraffic::getElevationAtPosition(const std::string &callsign, double latitudeDeg, double longitudeDeg, double altitudeMeters) const
|
||||
{
|
||||
if (getSettings().isTerrainProbeEnabled()) { return std::numeric_limits<double>::quiet_NaN(); }
|
||||
|
||||
auto planeIt = m_planesByCallsign.find(callsign);
|
||||
if (planeIt != m_planesByCallsign.end())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user