mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Added SORD interface (Connection to the Vectronix Vector LRF)
This commit is contained in:
parent
769ad60018
commit
40e013ed6d
@ -21,4 +21,5 @@ if (count (profileNamespace getVariable ["ACE_ATragMX_gunList", []]) > 0) then {
|
|||||||
};
|
};
|
||||||
|
|
||||||
[] call FUNC(init);
|
[] call FUNC(init);
|
||||||
//[] call FUNC(sord); // Connection to Vector
|
|
||||||
|
["RangerfinderData", {_this call FUNC(sord)}] call EFUNC(common,addEventHandler);
|
||||||
|
@ -1,37 +1,27 @@
|
|||||||
/*
|
/*
|
||||||
* Author: Ruthberg
|
* Author: Ruthberg
|
||||||
* Hook the rangefinder lazing event
|
* Handles incoming data packets from the Vectronix Vector LRF
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* Nothing
|
* 0: Slope distance (Meters) <NUMBER>
|
||||||
|
* 1: Azimuth (Degrees) <NUMBER>
|
||||||
|
* 2: Inclination (Degrees) <NUMBER>
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* Nothing
|
* Nothing
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* call ace_atragmx_sord
|
* [1000, 45, 1] call ace_microdagr_fnc_recieveRangefinderData
|
||||||
*
|
*
|
||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#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"];
|
//_inclination = asin((ACE_player weaponDirection currentWeapon ACE_player) select 2);
|
||||||
|
GVAR(inclinationAngle) set [GVAR(currentTarget), _inclination];
|
||||||
_fnc_atragmx = {
|
GVAR(targetRange) set [GVAR(currentTarget), _slopeDistance];
|
||||||
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;
|
|
||||||
|
Loading…
Reference in New Issue
Block a user