From 731846a0c654b39e23c26f611470e401df404c9d Mon Sep 17 00:00:00 2001 From: Mel Date: Thu, 6 Oct 2022 01:42:52 +0200 Subject: Relative to camera movement --- src/Math/Matrix.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/Math') 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 transpose() { + Matrix 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 operator+(Matrix other) { Matrix result{}; for (int i = 0; i < R * C; i++) { -- cgit 1.4.1