1 #ifndef DQM_TRACKERREMAPPER_MAT4_H
2 #define DQM_TRACKERREMAPPER_MAT4_H
45 for (
unsigned i = 0;
i < 12; ++
i)
51 for (
unsigned i = 0;
i < 12; ++
i)
59 for (
unsigned i = 0;
i < 12; ++
i)
60 tmp[
i] = (*
this)[
i] + mat[
i];
67 for (
unsigned i = 0;
i < 12; ++
i)
68 tmp[
i] = (*
this)[
i] *
s;
77 void MulVec(
const float* vecIn,
float* vecOut) {
78 for (
unsigned i = 0;
i < 3; ++
i) {
80 for (
unsigned j = 0;
j < 3; ++
j) {
81 temp +=
data[3 *
j +
i] * vecIn[
j];
83 vecOut[
i] = temp +
data[9 +
i];
87 float rmli = 1.0f / (right - left);
88 float rpl = right + left;
90 float tmbi = 1.0f / (top - bottom);
91 float tpb = top + bottom;
93 float fmni = 1.0f / (far - near);
94 float fpn = far + near;
96 data[0] = 2.0f * rmli;
101 data[4] = 2.0f * tmbi;
106 data[8] = -2.0f * fmni;
108 data[9] = -rpl * rmli;
109 data[10] = -tpb * tmbi;
110 data[11] = -fpn * fmni;
void BuildOrthographicMatrix(float left, float right, float top, float bottom, float near, float far)
mat4 operator*(float s) const
mat4 operator+(const mat4 &mat) const
float & operator[](unsigned i)
mat4 & operator&(const mat4 &mat)
mat4(float r00, float r10, float r20, float r01, float r11, float r21, float r02, float r12, float r22, float x, float y, float z)
float operator[](unsigned i) const
void MulVec(const float *vecIn, float *vecOut)