Added SORD interface (Connection to the Vectronix Vector LRF)

This commit is contained in:
ulteq 2015-04-12 19:51:13 +02:00
parent 769ad60018
commit 40e013ed6d
2 changed files with 14 additions and 23 deletions

View File

@ -21,4 +21,5 @@ if (count (profileNamespace getVariable ["ACE_ATragMX_gunList", []]) > 0) then {
};
[] call FUNC(init);
//[] call FUNC(sord); // Connection to Vector
["RangerfinderData", {_this call FUNC(sord)}] call EFUNC(common,addEventHandler);

View File

@ -1,37 +1,27 @@
/*
* Author: Ruthberg
* Hook the rangefinder lazing event
* Handles incoming data packets from the Vectronix Vector LRF
*
* Arguments:
* Nothing
* 0: Slope distance (Meters) <NUMBER>
* 1: Azimuth (Degrees) <NUMBER>
* 2: Inclination (Degrees) <NUMBER>
*
* Return Value:
* Nothing
*
* Example:
* call ace_atragmx_sord
* [1000, 45, 1] call ace_microdagr_fnc_recieveRangefinderData
*
* Public: No
*/
#include "script_component.hpp"
GVAR(COMPAT_LRF) = ["Rangefinder", "Laserdesignator"];
private ["_slopeDistance", "_azimuth", "_inclination"];
_slopeDistance = _this select 0;
_azimuth = _this select 1;
_inclination = _this select 2;
private ["_fnc_atragmx"];
_fnc_atragmx = {
private ["_target", "_position", "_range", "_inclinationAngle"];
if ((local ACE_player) && (currentWeapon ACE_player) in GVAR(COMPAT_LRF) && (!isNull (_this select 0))) then {
_target = getPosATL (_this select 0);
_position = getPosATL ACE_player;
_inclinationAngle = asin((ACE_player weaponDirection currentWeapon ACE_player) select 2);
_range = _position distance _target;
GVAR(inclinationAngle) set [GVAR(currentTarget), _inclinationAngle];
GVAR(targetRange) set [GVAR(currentTarget), _range];
};
};
//["ace_sys_rangefinder_Lazing", _fnc_atragmx] call CBA_fnc_addEventHandler;
//_inclination = asin((ACE_player weaponDirection currentWeapon ACE_player) select 2);
GVAR(inclinationAngle) set [GVAR(currentTarget), _inclination];
GVAR(targetRange) set [GVAR(currentTarget), _slopeDistance];