ACE3/addons/common/functions/fnc_createOrthonormalReference.sqf

22 lines
452 B
Plaintext
Raw Normal View History

/*
2015-03-24 04:18:00 +00:00
* Author: esteldunedain
*
* Returns a orthonormal system of reference aligned with the supplied vector
*
* Argument:
* Vector to align the coordinate system with (Array)
*
* Return value:
* 0: v1 (Array)
* 1: v2 (Array)
* 2: v3 (Array)
*/
#include "script_component.hpp"
private ["_v1","_v2","_v3"];
_v1 = vectorNormalized _this;
_v2 = vectorNormalized (_v1 vectorCrossProduct [0,0,1]);
_v3 = _v2 vectorCrossProduct _v1;
[_v1,_v2,_v3]