diff options
| author | Mel <einebeere@gmail.com> | 2022-10-06 01:42:52 +0200 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2022-10-06 01:42:52 +0200 |
| commit | 731846a0c654b39e23c26f611470e401df404c9d (patch) | |
| tree | d48a0f4160adaabaf2511808ba0519dc005fa44c /src/Math/Matrix.hpp | |
| parent | 1474eb20033d809f85621b8b1060df362a239557 (diff) | |
| download | meowcraft-731846a0c654b39e23c26f611470e401df404c9d.tar.zst meowcraft-731846a0c654b39e23c26f611470e401df404c9d.zip | |
Relative to camera movement
Diffstat (limited to 'src/Math/Matrix.hpp')
| -rw-r--r-- | src/Math/Matrix.hpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Math/Matrix.hpp b/src/Math/Matrix.hpp index 43f0721..d77760a 100644 --- a/src/Math/Matrix.hpp +++ b/src/Math/Matrix.hpp @@ -78,6 +78,16 @@ public: return result; } + Matrix<R, C, T> transpose() { + Matrix<R, C, T> result{}; + for (int y = 0; y < R; y++) { + for (int x = 0; x < C; x++) { + result(x, y) = this->operator()(y, x); + } + } + return result; + } + Matrix<R, C, T> operator+(Matrix<R, C, T> other) { Matrix<R, C, T> result{}; for (int i = 0; i < R * C; i++) { |
