Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use BI's new matrix commands #1173

Merged
merged 2 commits into from
Jun 30, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions addons/vectors/fnc_matrixProduct3D.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,4 @@ Author:

params [["_matrixA", [], [[]], 3], ["_matrixB", [], [[]], 3]];

_matrixB = [_matrixB] call CBA_fnc_matrixTranspose;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where did the transpose go?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for transpose anymore. It was just a workaround for an easier access to column vectors as 1D arrays, since vectorDotProduct only supports 1D arrays.

_matrixA apply {
private _rowA = _x;
_matrixB apply {_rowA vectorDotProduct _x}
} // return
_matrixA matrixMultiply _matrixB
8 changes: 1 addition & 7 deletions addons/vectors/fnc_matrixTranspose.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,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