-
Notifications
You must be signed in to change notification settings - Fork 0
/
Mat3.h
26 lines (22 loc) · 839 Bytes
/
Mat3.h
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 MAT3__H_
#define MAT3__H_
// class Mat3
// basic matrix class, supports construction from list of floats (in row-major order), construction of diagonal matrix from float and construction from column vectors
// as well as matrix multiplication and memberwise addition
class Vec3;
typedef class Mat3
{
public:
Mat3(const float a00, const float a10, const float a20, const float a01, const float a11, const float a21, const float a02, const float a12, const float a22);
Mat3(const float a);
Mat3(const Vec3 &c1, const Vec3 &c2, const Vec3 &c3);
Mat3 &operator*=(const Mat3 &rhs);
Mat3 operator*(const Mat3 &rhs) const;
Mat3 &operator*=(const float rhs);
Mat3 operator*(const float rhs) const;
Mat3 &operator+=(const Mat3 &rhs);
Mat3 operator+(const Mat3 &rhs) const;
public:
float m_data[3][3];
} Mat3;
#endif //MAT3__H_