-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGLMatrix.hpp
More file actions
41 lines (29 loc) · 764 Bytes
/
GLMatrix.hpp
File metadata and controls
41 lines (29 loc) · 764 Bytes
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
#pragma once
#include <math.h>
#include <cstddef>
#include "GLPoint.hpp"
#include "GLVector.hpp"
class GLMatrix {
public:
GLMatrix();
void setColumn(int i, const GLPoint &rhs);
void setColumn(int i, const GLVector &rhs);
void setValue(const int row, const int column, const float value);
GLVector getColumn(int i) const;
bool inverse();
double operator()(int row, int column) const;
private:
double mMatrix[16];
};
/**
** Gibt die Einträge der Matrix auf drei Nachkommastellen gerundet aus
**/
inline std::ostream &operator<<(std::ostream &os, const GLMatrix &m) {
for (size_t i = 0; i < 4; ++i) {
for (size_t j = 0; j < 4; ++j) {
os << round(m(i, j) * 1000.0f) / 1000.0f << " ";
}
os << "\n";
}
return os;
}