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"
|
|
|
|
|
|
|
|
private ["_scopeBaseAngle"];
|
2015-04-16 16:14:32 +00:00
|
|
|
_scopeBaseAngle = (GVAR(workingMemory) select 3);
|
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"];
|
2015-04-17 22:11:53 +00:00
|
|
|
_zeroRange = Round(parseNumber(ctrlText 120060));
|
|
|
|
if (GVAR(currentUnit) == 1) then {
|
2015-04-07 20:44:26 +00:00
|
|
|
_zeroRange = _zeroRange / 1.0936133;
|
2015-04-06 13:51:59 +00:00
|
|
|
};
|
2015-04-10 09:14:13 +00:00
|
|
|
if (_zeroRange < 10) exitWith {
|
2015-04-16 16:14:32 +00:00
|
|
|
GVAR(workingMemory) set [2, _zeroRange];
|
|
|
|
GVAR(workingMemory) set [3, 0];
|
2015-04-10 09:14:13 +00:00
|
|
|
};
|
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);
|
2015-04-06 13:51:59 +00:00
|
|
|
|
|
|
|
private ["_result"];
|
2015-04-17 22:11:53 +00:00
|
|
|
_result = [_scopeBaseAngle, _bulletMass, _boreHeight, _airFriction, _muzzleVelocity, _temperature, _barometricPressure, _relativeHumidity, 1000, 0, 0, 0, 0, _zeroRange, _bc, _dragModel, _atmosphereModel, false, 1.5, 0, 0] call FUNC(calculate_solution);
|
2015-04-06 13:51:59 +00:00
|
|
|
|
2015-04-16 16:14:32 +00:00
|
|
|
GVAR(workingMemory) set [2, _zeroRange];
|
|
|
|
GVAR(workingMemory) set [3, _scopeBaseAngle + (_result select 0) / 60];
|