PCB Environment 2
Loading...
Searching...
No Matches
Mat4.hpp
1
2#ifndef GYM_PCB_MATH_MAT4_H
3#define GYM_PCB_MATH_MAT4_H
4
5#include "Geometry.hpp"
6#include <cassert>
7
8namespace math
9{
10
11class Mat4
12{
13public:
14 Mat4() { }
15 Mat4(Real all);
16 Mat4(const Real *);
17
18 const Real *data() const { return &m[0]; }
19
20 Real& operator[](uint i) { assert(i < 16); return m[i]; }
21 Real operator[](uint i) const { assert(i < 16); return m[i]; }
22
23 Mat4& operator=(const Mat4&);
24
25 Mat4& operator+=(const Mat4&);
26 Mat4 operator+(const Mat4&) const;
27 Mat4& operator-=(const Mat4&);
28 Mat4 operator-(const Mat4&) const;
29 Mat4& operator*=(Real);
30 Mat4 operator*(Real) const;
31
32 Mat4& operator*=(const Mat4&);
33 Mat4 operator*(const Mat4&) const;
34
35 Mat4& setOrtho(const Vector_3 &L_B_N, const Vector_3 &R_T_F);
36
37 std::string str() const;
38
39private:
40 Real m[16];
41
42public:
43 static const Mat4 ID;
44 static const Mat4 ZERO;
45};
46
47} // namespace math
48
49#endif // GYM_PCB_MATH_MAT4_H