From 1c2af4eff0b8199e7423ddf97e9946ffd9e76619 Mon Sep 17 00:00:00 2001 From: Tomila Bakeeva Date: Sun, 16 Nov 2025 21:45:53 +0100 Subject: [PATCH] Entwickler: gamematrix.h aktualisiert --- includes/gamematrix.h | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/includes/gamematrix.h b/includes/gamematrix.h index 7a644d6..c964857 100644 --- a/includes/gamematrix.h +++ b/includes/gamematrix.h @@ -4,16 +4,20 @@ #include #include -class gameMatrix +namespace Matrix3D { -public: - // Matrix Multiplikation - static std::array,4> matmul(const std::array,4>& A, - const std::array,4>& B); + using Vec3 = std::array; + using Vec4 = std::array; + using Mat4 = std::array, 4>; - // Rotationsmatrix um Achse x/y/z - static std::array,4> rot3D(double angle_deg, char axis); - - // Verschiebung - static std::array,4> translate(const std::array& pos); -}; + class gameMatrix + { + public: + static Mat4 identity(); + static Mat4 matmul(const Mat4& A, const Mat4& B); + static Mat4 translate(const Vec3& pos); + static Mat4 rot3D(double angle_deg, char axis); + }; + Mat4 operator*(const Mat4& A, const Mat4& B); + Vec3 operator*(const Mat4& m, const Vec3& v); +} \ No newline at end of file