ACE3/addons/common/functions/fnc_translateToWeaponSpace.sqf
2015-09-20 15:52:40 +02:00

31 lines
619 B
Plaintext

/*
* Author: ?
* ?
*
* Arguments:
* ?
*
* Return Value:
* ?
*
* Public: ?
*/
#include "script_component.hpp"
params ["_object", "_matrix", "_offset"];
private "_origin";
_origin = getPosASL _object;
_matrix params ["_xVec", "_yVec", "_zVec"];
_offset = _offset vectorDiff _origin;
_offset params ["_x", "_y", "_z"];
[
((_xVec select 0) * _x) + ((_xVec select 1) * _y) + ((_xVec select 2) * _z),
((_yVec select 0) * _x) + ((_yVec select 1) * _y) + ((_yVec select 2) * _z),
((_zVec select 0) * _x) + ((_zVec select 1) * _y) + ((_zVec select 2) * _z)
] // return