2015-01-25 03:56:23 +00:00
|
|
|
/*
|
2015-03-24 04:18:00 +00:00
|
|
|
* Author: esteldunedain
|
2015-01-25 03:56:23 +00:00
|
|
|
* Returns a orthonormal system of reference aligned with the supplied vector
|
|
|
|
*
|
2017-06-08 13:31:51 +00:00
|
|
|
* Arguments:
|
2015-09-18 14:41:00 +00:00
|
|
|
* Vector to align the coordinate system with <ARRAY>
|
2015-01-25 03:56:23 +00:00
|
|
|
*
|
2015-09-18 13:40:51 +00:00
|
|
|
* Return Value:
|
|
|
|
* 0: Vector Normalized <ARRAY>
|
|
|
|
* 1: Normalized Cross Product Vector <ARRAY>
|
|
|
|
* 2: Vector Cross Product <ARRAY>
|
|
|
|
*
|
2017-06-08 13:31:51 +00:00
|
|
|
* Example:
|
|
|
|
* [[0,0,0]] call ace_common_fnc_createOrthonormalReference
|
|
|
|
*
|
2015-09-18 13:40:51 +00:00
|
|
|
* Public: Yes
|
2015-01-25 03:56:23 +00:00
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-12-12 15:48:54 +00:00
|
|
|
[_this] params [["_vector", [0,0,1], [[]], 3]];
|
2015-09-18 13:40:51 +00:00
|
|
|
|
2015-12-12 15:48:54 +00:00
|
|
|
private _v1 = vectorNormalized _this;
|
|
|
|
private _v2 = vectorNormalized (_v1 vectorCrossProduct [0,0,1]);
|
|
|
|
private _v3 = _v2 vectorCrossProduct _v1;
|
2015-01-25 03:56:23 +00:00
|
|
|
|
2015-12-12 15:48:54 +00:00
|
|
|
[_v1, _v2, _v3]
|