Skip to content

Commit

Permalink
Use BI's new matrix commands (#1173)
Browse files Browse the repository at this point in the history
* Use BI's new matrix commands

* Add DEPRECATED markers
  • Loading branch information
Kexanone authored and commy2 committed Jun 30, 2019
1 parent 07a2e04 commit 42622e9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
8 changes: 3 additions & 5 deletions addons/vectors/fnc_matrixProduct3D.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Description:
Only accepts 3x3 matrices.
DEPRECATED. Use matrixMultiply instead.
Parameters:
_matrixA - first 3x3 matrix. <ARRAY>
_matrixB - second 3x3 matrix. <ARRAY>
Expand All @@ -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
10 changes: 3 additions & 7 deletions addons/vectors/fnc_matrixTranspose.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Description:
Accepts any mxn matrix.
DEPRECATED. Use matrixTranspose instead.
Parameters:
_matrix - mxn matrix to transpose. <ARRAY>
Expand All @@ -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
2 changes: 1 addition & 1 deletion addons/vectors/fnc_vectMap3D.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ Author:

params [["_matrix", [], [[]], 3], ["_vector", [], [[]], 3]];

_matrix apply {_x vectorDotProduct _vector} // return
([_vector] matrixMultiply matrixTranspose _matrix) select 0

0 comments on commit 42622e9

Please sign in to comment.