+#include <Main/fg_props.hxx>
+
#include "Math.hpp"
#include "Atmosphere.hpp"
namespace yasim {
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)