forked from scp-fs2open/PCS2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
matrix3d.h
54 lines (31 loc) · 929 Bytes
/
matrix3d.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include <ios>
#include <vector>
#ifndef _MATRIX3D_H_
#define _MATRIX3D_H_
#include "vector3d.h"
#include <sstream>
#define MATRIX_SIZE 3
std::string write_vector3d(vector3d vec,vector3d scale);
struct matrix {
float a2d[MATRIX_SIZE][MATRIX_SIZE];
matrix();
// Construct a change of basis from e1,e2,e3 to the given vector
matrix(vector3d basis);
// Construct a rotation matrix from a given rotation angle
matrix(float angle);
matrix(std::vector<float> *matrix);
matrix inverse();
std::string tostring() const;
float scale();
matrix(float f[3][3]);
matrix(vector3d r, vector3d u, vector3d f);
matrix(const matrix&m);
matrix operator=(const matrix&m);
matrix operator * (const float&f);
matrix operator + (const matrix&m);
matrix invert();
float determinant() const;
};
vector3d operator *(matrix matrix, vector3d vec);
matrix operator %(matrix one, matrix two);
#endif /* _MATRIX3D_H_ */