From: david Date: Wed, 15 May 2002 12:10:48 +0000 (+0000) Subject: Take the static temperature, static pressure, and density values from X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=52c1cb2f7d55d1e34a546446aa816b65c745dbfa;p=flightgear.git Take the static temperature, static pressure, and density values from an external source if requested by the /environment/params/control-fdm-atmosphere property. --- diff --git a/src/FDM/YASim/Atmosphere.cpp b/src/FDM/YASim/Atmosphere.cpp index 18b54dd24..bc8a754dd 100644 --- a/src/FDM/YASim/Atmosphere.cpp +++ b/src/FDM/YASim/Atmosphere.cpp @@ -1,3 +1,5 @@ +#include
+ #include "Math.hpp" #include "Atmosphere.hpp" namespace yasim { @@ -40,17 +42,26 @@ const float GAMMA = 1.4f; float Atmosphere::getStdTemperature(float alt) { - return getRecord(alt, 1); + if (fgGetBool("/environment/params/control-fdm-atmosphere")) + return fgGetDouble("/environment/temperature-degC") + 273.15; + else + return getRecord(alt, 1); } float Atmosphere::getStdPressure(float alt) { - return getRecord(alt, 2); + if (fgGetBool("/environment/params/control-fdm-atmosphere")) + return fgGetDouble("/environment/pressure-inhg") * 3386.39; + else + return getRecord(alt, 2); } float Atmosphere::getStdDensity(float alt) { - return getRecord(alt, 3); + if (fgGetBool("/environment/params/control-fdm-atmosphere")) + return fgGetDouble("/environment/density-slugft3") * 515.378; + else + return getRecord(alt, 3); } float Atmosphere::calcVEAS(float spd, float pressure, float temp)