Advanced Ballistics - Fixed faulty wind attenuation (#5869)

* Advanced Ballistics - Fixed faulty wind attenuation
* Only relevant at very low altitudes above ground (below 1.6 m)
* Also fixes the Kestrel 4500 readout

* Kestrel 4500 - Minor optimization / fix
* Avoids possible math error 'ln(0)'

* Rebuild Dills
This commit is contained in:
ulteq 2017-12-08 17:44:12 +01:00 committed by PabstMirror
parent 534898a680
commit 77fd2007ea
5 changed files with 4 additions and 5 deletions

Binary file not shown.

Binary file not shown.

View File

@ -34,10 +34,9 @@ private _windDirAdjusted = _windDir + 180;
if (_windGradientEnabled) then { if (_windGradientEnabled) then {
if (_windSpeed > 0.05) then { if (_windSpeed > 0.05) then {
private _height = (ASLToATL _position) select 2; private _height = (ASLToATL _position) select 2;
_height = 0 max _height min 20; if (_height > 0 && _height < 20) then {
if (_height < 20) then {
private _roughnessLength = _position call FUNC(calculateRoughnessLength); private _roughnessLength = _position call FUNC(calculateRoughnessLength);
_windSpeed = _windSpeed * abs(ln(_height / _roughnessLength) / ln(20 / _roughnessLength)); _windSpeed = _windSpeed * (0 max (ln(_height / _roughnessLength) / ln(20 / _roughnessLength)));
}; };
}; };
}; };

View File

@ -89,7 +89,7 @@ endif()
string(TIMESTAMP ACE_BUILDSTAMP "%Y-%m-%dT%H:%M:%SZ") string(TIMESTAMP ACE_BUILDSTAMP "%Y-%m-%dT%H:%M:%SZ")
set(ACE_VERSION_MAJOR 3) set(ACE_VERSION_MAJOR 3)
set(ACE_VERSION_MINOR 11) set(ACE_VERSION_MINOR 12)
set(ACE_VERSION_REVISION 0) set(ACE_VERSION_REVISION 0)
EXECUTE_PROCESS(COMMAND git rev-parse --verify HEAD EXECUTE_PROCESS(COMMAND git rev-parse --verify HEAD
OUTPUT_VARIABLE T_ACE_VERSION_BUILD OUTPUT_VARIABLE T_ACE_VERSION_BUILD

View File

@ -530,7 +530,7 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function)
windSourceObstacles = bulletPosition - windVelocity.normalize() * 25; windSourceObstacles = bulletPosition - windVelocity.normalize() * 25;
double roughnessLength = calculateRoughnessLength(windSourceObstacles.x(), windSourceObstacles.y()); double roughnessLength = calculateRoughnessLength(windSourceObstacles.x(), windSourceObstacles.y());
windAttenuation *= abs(log(heightAGL / roughnessLength) / log(20 / roughnessLength)); windAttenuation *= std::max(0.0, log(heightAGL / roughnessLength) / log(20 / roughnessLength));
} }
windVelocity = windVelocity * windAttenuation; windVelocity = windVelocity * windAttenuation;