aboutsummaryrefslogtreecommitdiff
path: root/src/math/mat4.h
blob: 6df9d4980fe9895cf55632aa4315f4f871fe2061 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef MATH_MAT4_H
#define MATH_MAT4_H

#include <array>
#include "math/math_vector.h"

class Mat4 {
    public:
        static Mat4 idty();
        static Mat4 translate(MathVector3 v);
        static Mat4 scale(float fac);
        static Mat4 rot_x(float a);
        static Mat4 rot_y(float a);
        static Mat4 rot_z(float a);
        static Mat4 projection(float aspect_ratio, float min_z, float max_z);

        std::array<float, 16> values;

        Mat4 operator+();
        Mat4 operator-();
        Mat4 operator+(Mat4 m);
        Mat4 operator-(Mat4 m);
        Mat4 operator*(Mat4 m);
        MathVector4 operator*(MathVector4 v);
        std::array<MathVector4, 4> to_vecs();
};

Mat4 operator*(float fac, Mat4 m);

#endif // MATH_MAT4_H