mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
27 lines
545 B
Plaintext
27 lines
545 B
Plaintext
#include "script_component.hpp"
|
|
/*
|
|
* Author: Gundy
|
|
*
|
|
* Description:
|
|
* Returns compass direction (horizontal) from first position to second position
|
|
*
|
|
* Arguments:
|
|
* 0: 2D or 3D position <ARRAY>
|
|
* 1: 2D or 3D position <ARRAY>
|
|
*
|
|
* Return Value:
|
|
* Direction (0 - 360) <FLOAT>
|
|
*
|
|
* Example:
|
|
* [getPosATL player, [0,0,0]] call ace_bft_devices_fnc_dirTo;
|
|
*
|
|
* Public: No
|
|
*/
|
|
|
|
|
|
params ["_pos1", "_pos2"];
|
|
|
|
private _dirTo = ((_pos2 select 0) - (_pos1 select 0)) atan2 ((_pos2 select 1) - (_pos1 select 1));
|
|
|
|
(_dirTo + 360) % 360
|