summaryrefslogtreecommitdiff
path: root/engine/matrix.h
blob: 8be483a88b3d84ba0e60844b569bf5ac3633cd2f (plain)
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
#ifndef MATRIX_H
#define MATRIX_H

#include "vector.h"

template<int M, int N>
class Matrix {
	public:
		float m[M][N];
};

class Matrix2 : Matrix<2, 2> {
	public:
		Matrix2();
		Matrix2(float m00, float m01, float m10, float m11);
		
		Matrix2 operator*(const Matrix2& mat);
		
		Matrix2 operator*(float f);
		
		Vector2 operator*(const Vector2& v);
};

Matrix2 rotation_matrix(float rot);

#endif