2015-04-11 21:40:46 +00:00
|
|
|
/*
|
|
|
|
* Author: Ruthberg
|
|
|
|
* Updates the scope base angle based on the zero range input
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* Nothing
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* Nothing
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* call ace_atragmx_fnc_update_zero_range
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2015-04-06 13:51:59 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2016-11-02 17:05:19 +00:00
|
|
|
[] call FUNC(parse_input);
|
|
|
|
|
2015-04-06 13:51:59 +00:00
|
|
|
private ["_bulletMass", "_boreHeight", "_airFriction", "_muzzleVelocity", "_bc", "_dragModel", "_atmosphereModel"];
|
2015-04-16 16:14:32 +00:00
|
|
|
_bulletMass = GVAR(workingMemory) select 12;
|
|
|
|
_boreHeight = GVAR(workingMemory) select 5;
|
|
|
|
_airFriction = GVAR(workingMemory) select 4;
|
|
|
|
_muzzleVelocity = GVAR(workingMemory) select 1;
|
|
|
|
_bc = GVAR(workingMemory) select 15;
|
|
|
|
_dragModel = GVAR(workingMemory) select 16;
|
|
|
|
_atmosphereModel = GVAR(workingMemory) select 17;
|
2015-04-06 13:51:59 +00:00
|
|
|
|
|
|
|
private ["_zeroRange"];
|
2016-11-02 17:05:19 +00:00
|
|
|
_zeroRange = GVAR(workingMemory) select 2;
|
2015-04-06 13:51:59 +00:00
|
|
|
|
2015-04-17 22:11:53 +00:00
|
|
|
private ["_altitude", "_temperature", "_barometricPressure", "_relativeHumidity"];
|
|
|
|
_altitude = GVAR(altitude);
|
2015-04-16 16:14:32 +00:00
|
|
|
_temperature = GVAR(temperature);
|
|
|
|
_barometricPressure = GVAR(barometricPressure);
|
|
|
|
_relativeHumidity = GVAR(relativeHumidity);
|
2016-11-02 17:05:19 +00:00
|
|
|
if (!GVAR(atmosphereModeTBH)) then {
|
|
|
|
_barometricPressure = 1013.25 * (1 - (0.0065 * _altitude) / (273.15 + _temperature + 0.0065 * _altitude)) ^ 5.255754495;
|
|
|
|
_relativeHumidity = 50;
|
|
|
|
};
|
2015-04-06 13:51:59 +00:00
|
|
|
|
2016-11-09 13:00:25 +00:00
|
|
|
private _scopeBaseAngle = if (!(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false])) then {
|
|
|
|
private _zeroAngle = "ace_advanced_ballistics" callExtension format ["zeroAngleVanilla:%1:%2:%3:%4", _zeroRange, _muzzleVelocity, _airFriction, _boreHeight];
|
|
|
|
(parseNumber _zeroAngle)
|
|
|
|
} else {
|
|
|
|
private _zeroAngle = "ace_advanced_ballistics" callExtension format ["zeroAngle:%1:%2:%3:%4:%5:%6:%7:%8:%9", _zeroRange, _muzzleVelocity, _boreHeight, _temperature, _barometricPressure, _relativeHumidity, _bc, _dragModel, _atmosphereModel];
|
|
|
|
(parseNumber _zeroAngle)
|
|
|
|
};
|
2015-04-06 13:51:59 +00:00
|
|
|
|
2015-04-16 16:14:32 +00:00
|
|
|
GVAR(workingMemory) set [2, _zeroRange];
|
2016-11-02 17:05:19 +00:00
|
|
|
GVAR(workingMemory) set [3, _scopeBaseAngle];
|