From 42622e9d98421e2e93b19234c76598e673882fb0 Mon Sep 17 00:00:00 2001 From: Kex Date: Sun, 30 Jun 2019 21:21:58 +0200 Subject: [PATCH] Use BI's new matrix commands (#1173) * Use BI's new matrix commands * Add DEPRECATED markers --- addons/vectors/fnc_matrixProduct3D.sqf | 8 +++----- addons/vectors/fnc_matrixTranspose.sqf | 10 +++------- addons/vectors/fnc_vectMap3D.sqf | 2 +- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/addons/vectors/fnc_matrixProduct3D.sqf b/addons/vectors/fnc_matrixProduct3D.sqf index 903b6dc4d..8511304bc 100755 --- a/addons/vectors/fnc_matrixProduct3D.sqf +++ b/addons/vectors/fnc_matrixProduct3D.sqf @@ -7,6 +7,8 @@ Description: Only accepts 3x3 matrices. + DEPRECATED. Use matrixMultiply instead. + Parameters: _matrixA - first 3x3 matrix. _matrixB - second 3x3 matrix. @@ -26,8 +28,4 @@ Author: params [["_matrixA", [], [[]], 3], ["_matrixB", [], [[]], 3]]; -_matrixB = [_matrixB] call CBA_fnc_matrixTranspose; -_matrixA apply { - private _rowA = _x; - _matrixB apply {_rowA vectorDotProduct _x} -} // return +_matrixA matrixMultiply _matrixB diff --git a/addons/vectors/fnc_matrixTranspose.sqf b/addons/vectors/fnc_matrixTranspose.sqf index bbf2a6eb7..456f85395 100755 --- a/addons/vectors/fnc_matrixTranspose.sqf +++ b/addons/vectors/fnc_matrixTranspose.sqf @@ -7,6 +7,8 @@ Description: Accepts any mxn matrix. + DEPRECATED. Use matrixTranspose instead. + Parameters: _matrix - mxn matrix to transpose. @@ -25,10 +27,4 @@ Author: params [["_matrix", [], [[]]]]; -private _returnMatrix = []; - -for "_j" from 0 to (count (_matrix select 0) - 1) do { - _returnMatrix pushBack (_matrix apply {_x select _j}); -}; - -_returnMatrix +matrixTranspose _matrix diff --git a/addons/vectors/fnc_vectMap3D.sqf b/addons/vectors/fnc_vectMap3D.sqf index ac231412b..060c4db9e 100755 --- a/addons/vectors/fnc_vectMap3D.sqf +++ b/addons/vectors/fnc_vectMap3D.sqf @@ -26,4 +26,4 @@ Author: params [["_matrix", [], [[]], 3], ["_vector", [], [[]], 3]]; -_matrix apply {_x vectorDotProduct _vector} // return +([_vector] matrixMultiply matrixTranspose _matrix) select 0