Prog3b_651/includes/gamematrix.h

23 lines
585 B
C++

#pragma once
#include <vector>
#include <array>
#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:
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);
}