Fixed incorrect unit conversion in the barometric pressure calculation

This commit is contained in:
ulteq 2015-05-29 10:30:30 +02:00
parent e2970ab40e
commit 83f2e35907
4 changed files with 4 additions and 4 deletions

View File

@ -47,7 +47,7 @@ _temperature = GVAR(temperature);
_barometricPressure = GVAR(barometricPressure);
_relativeHumidity = GVAR(relativeHumidity);
if (!GVAR(atmosphereModeTBH)) then {
_barometricPressure = 1013.25 * exp(-(_altitude) / 7990);
_barometricPressure = (101325 * exp(-(_altitude) / 7990)) / 100;
_relativeHumidity = 50;
};

View File

@ -47,7 +47,7 @@ _temperature = GVAR(temperature);
_barometricPressure = GVAR(barometricPressure);
_relativeHumidity = GVAR(relativeHumidity);
if (!GVAR(atmosphereModeTBH)) then {
_barometricPressure = 1013.25 * exp(-(_altitude) / 7990);
_barometricPressure = (101325 * exp(-(_altitude) / 7990)) / 100;
_relativeHumidity = 50;
};

View File

@ -14,4 +14,4 @@
*/
#include "script_component.hpp"
(1013.25 * exp(-(GVAR(Altitude) + _this) / 7990) - 10 * overcast)
(101325 * exp(-(GVAR(Altitude) + _this) / 7990) - 1000 * overcast) / 100

View File

@ -501,7 +501,7 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function)
trueSpeed = sqrt(pow(trueVelocity[0], 2) + pow(trueVelocity[1], 2) + pow(trueVelocity[2], 2));
temperature = bulletDatabase[index].temperature - 0.0065 * position[2];
pressure = 1013.25 * exp(-(bulletDatabase[index].altitude + position[2]) / 7990) - 10 * bulletDatabase[index].overcast;
pressure = (101325 * exp(-(bulletDatabase[index].altitude + position[2]) / 7990) - 1000 * bulletDatabase[index].overcast) / 100;
if (bulletDatabase[index].ballisticCoefficients.size() == bulletDatabase[index].velocityBoundaries.size() + 1) {
dragRef = deltaT * bulletDatabase[index].airFriction * bulletSpeed * bulletSpeed;