2015-06-07 15:53:37 +00:00
|
|
|
/*
|
|
|
|
* Author: Rosuto, Ruthberg
|
|
|
|
* Handles incoming data packets from the Vectronix Vector LRF
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Slope distance (Meters) <NUMBER>
|
|
|
|
* 1: Azimuth (Degrees) <NUMBER>
|
|
|
|
* 2: Inclination (Degrees) <NUMBER>
|
|
|
|
*
|
|
|
|
* Return Value:
|
2017-06-08 13:31:51 +00:00
|
|
|
* None
|
2015-06-07 15:53:37 +00:00
|
|
|
*
|
|
|
|
* Example:
|
2015-06-11 09:56:25 +00:00
|
|
|
* [1000, 45, 1] call ace_dagr_fnc_handleRangeFinderData
|
2015-06-07 15:53:37 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-06-08 10:57:16 +00:00
|
|
|
#define EMP_RF_ACC 5 // Rangefinder Accuracy
|
2015-06-07 15:53:37 +00:00
|
|
|
|
|
|
|
PARAMS_3(_slopeDistance,_azimuth,_inclination);
|
|
|
|
|
2015-06-09 20:46:04 +00:00
|
|
|
if (GVAR(vectorConnected)) then {
|
2015-06-08 10:57:16 +00:00
|
|
|
GVAR(LAZPOS) = (eyePos player) vectorAdd ([_slopeDistance, _azimuth, _inclination] call CBA_fnc_polar2vect);
|
|
|
|
GVAR(LAZDIST) = _slopeDistance * cos(_inclination);
|
|
|
|
GVAR(LAZDIST) = floor (GVAR(LAZDIST) / EMP_RF_ACC) * EMP_RF_ACC;
|
|
|
|
GVAR(LAZHEADING) = _azimuth;
|
2015-06-09 20:46:04 +00:00
|
|
|
GVAR(noVectorData) = false;
|
2015-06-07 15:53:37 +00:00
|
|
|
};
|