Entwickler: gamematrix.h aktualisiert

This commit is contained in:
Tomila Bakeeva 2025-11-16 21:45:53 +01:00
parent e4e3bcf558
commit 1c2af4eff0

View File

@ -4,16 +4,20 @@
#include <stdexcept>
#include <cmath>
namespace Matrix3D
{
using Vec3 = std::array<double, 3>;
using Vec4 = std::array<double, 4>;
using Mat4 = std::array<std::array<double, 4>, 4>;
class gameMatrix
{
public:
// Matrix Multiplikation
static std::array<std::array<double,4>,4> matmul(const std::array<std::array<double,4>,4>& A,
const std::array<std::array<double,4>,4>& B);
// Rotationsmatrix um Achse x/y/z
static std::array<std::array<double,4>,4> rot3D(double angle_deg, char axis);
// Verschiebung
static std::array<std::array<double,4>,4> translate(const std::array<double, 3>& pos);
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);
}