3#include "../vec/vec4.h"
21 values[0][0] =
static_cast<T
>(0);
values[0][1] =
static_cast<T
>(0);
values[0][2] =
static_cast<T
>(0);
values[0][3] =
static_cast<T
>(0);
22 values[1][0] =
static_cast<T
>(0);
values[1][1] =
static_cast<T
>(0);
values[1][2] =
static_cast<T
>(0);
values[1][3] =
static_cast<T
>(0);
23 values[2][0] =
static_cast<T
>(0);
values[2][1] =
static_cast<T
>(0);
values[2][2] =
static_cast<T
>(0);
values[2][3] =
static_cast<T
>(0);
24 values[3][0] =
static_cast<T
>(0);
values[3][1] =
static_cast<T
>(0);
values[3][2] =
static_cast<T
>(0);
values[3][3] =
static_cast<T
>(0);
47 mat4(
const T& _a,
const T& _b,
const T& _c,
const T& _d,
48 const T& _e,
const T& _f,
const T& _g,
const T& _h,
49 const T& _i,
const T& _j,
const T& _k,
const T& _l,
50 const T& _m,
const T& _n,
const T& _o,
const T& _p)
77 explicit mat4(
const T& _a) {
79 values[0][0] = _a;
values[0][1] =
static_cast<T
>(0);
values[0][2] =
static_cast<T
>(0);
values[0][3] =
static_cast<T
>(0);
80 values[1][0] =
static_cast<T
>(0);
values[1][1] = _a;
values[1][2] =
static_cast<T
>(0);
values[1][3] =
static_cast<T
>(0);
81 values[2][0] =
static_cast<T
>(0);
values[2][1] =
static_cast<T
>(0);
values[2][2] = _a;
values[2][3] =
static_cast<T
>(0);
82 values[3][0] =
static_cast<T
>(0);
values[3][1] =
static_cast<T
>(0);
values[3][2] =
static_cast<T
>(0);
values[3][3] = _a;
96 static_cast<T
>(1),
static_cast<T
>(0),
static_cast<T
>(0),
static_cast<T
>(0),
97 static_cast<T
>(0),
static_cast<T
>(1),
static_cast<T
>(0),
static_cast<T
>(0),
98 static_cast<T
>(0),
static_cast<T
>(0),
static_cast<T
>(1),
static_cast<T
>(0),
99 static_cast<T
>(0),
static_cast<T
>(0),
static_cast<T
>(0),
static_cast<T
>(1));
109 m[0][0], m[0][1], m[0][2],
static_cast<T
>(0),
110 m[1][0], m[1][1], m[1][2],
static_cast<T
>(0),
111 m[2][0], m[2][1], m[2][2],
static_cast<T
>(0),
112 static_cast<T
>(0),
static_cast<T
>(0),
static_cast<T
>(0),
static_cast<T
>(1));
157 for(
size_t row = 0; row < 4; ++row) {
158 for(
size_t col = 0; col < 4; ++col) {
159 if(row != i && col != j) out[row][col];
248 lhs[0][0] * rhs.
x + lhs[0][1] * rhs.
y + lhs[0][2] * rhs.
z + lhs[0][3] * rhs.
w,
249 lhs[1][0] * rhs.
x + lhs[1][1] * rhs.
y + lhs[1][2] * rhs.
z + lhs[1][3] * rhs.
w,
250 lhs[2][0] * rhs.
x + lhs[2][1] * rhs.
y + lhs[2][2] * rhs.
z + lhs[2][3] * rhs.
w,
251 lhs[3][0] * rhs.
x + lhs[3][1] * rhs.
y + lhs[3][2] * rhs.
z + lhs[3][3] * rhs.
w
312 values[0][0] = _a * rhs[0][0] + _b*rhs[1][0] + _c * rhs[2][0] + _d*rhs[3][0];
313 values[0][1] = _a * rhs[0][1] + _b*rhs[1][1] + _c * rhs[2][1] + _d*rhs[3][1];
314 values[0][2] = _a * rhs[0][2] + _b*rhs[1][2] + _c * rhs[2][2] + _d*rhs[3][2];
315 values[0][3] = _a * rhs[0][3] + _b*rhs[1][3] + _c * rhs[2][3] + _d*rhs[3][3];
317 values[1][0] = _e * rhs[0][0] + _f*rhs[1][0] + _g * rhs[2][0] + _h*rhs[3][0];
318 values[1][1] = _e * rhs[0][1] + _f*rhs[1][1] + _g * rhs[2][1] + _h*rhs[3][1];
319 values[1][2] = _e * rhs[0][2] + _f*rhs[1][2] + _g * rhs[2][2] + _h*rhs[3][2];
320 values[1][3] = _e * rhs[0][3] + _f*rhs[1][3] + _g * rhs[2][3] + _h*rhs[3][3];
322 values[2][0] = _i * rhs[0][0] + _j*rhs[1][0] + _k * rhs[2][0] + _l*rhs[3][0];
323 values[2][1] = _i * rhs[0][1] + _j*rhs[1][1] + _k * rhs[2][1] + _l*rhs[3][1];
324 values[2][2] = _i * rhs[0][2] + _j*rhs[1][2] + _k * rhs[2][2] + _l*rhs[3][2];
325 values[2][3] = _i * rhs[0][3] + _j*rhs[1][3] + _k * rhs[2][3] + _l*rhs[3][3];
327 values[3][0] = _m * rhs[0][0] + _n*rhs[1][0] + _o * rhs[2][0] + _p*rhs[3][0];
328 values[3][1] = _m * rhs[0][1] + _n*rhs[1][1] + _o * rhs[2][1] + _p*rhs[3][1];
329 values[3][2] = _m * rhs[0][2] + _n*rhs[1][2] + _o * rhs[2][2] + _p*rhs[3][2];
330 values[3][3] = _m * rhs[0][3] + _n*rhs[1][3] + _o * rhs[2][3] + _p*rhs[3][3];
410 << mat[0][0] <<
", " << mat[0][1] <<
", " << mat[0][2] <<
", " << mat[0][3] <<
";\n\t"
411 << mat[1][0] <<
", " << mat[1][1] <<
", " << mat[1][2] <<
", " << mat[1][3] <<
";\n\t"
412 << mat[2][0] <<
", " << mat[2][1] <<
", " << mat[2][2] <<
", " << mat[2][3] <<
";\n\t"
413 << mat[3][0] <<
", " << mat[3][1] <<
", " << mat[3][2] <<
", " << mat[3][3] <<
"\n]\n";
std::ostream & operator<<(std::ostream &out, const mat4< U > &mat)
Definition: mat4.h:407
float Determinant()
Definition: mat3.h:125
mat4< T > & operator+=(const mat4< T > &rhs)
Definition: mat4.h:277
friend vec4< T > operator*(mat4< T > lhs, const vec4< T > &rhs)
Definition: mat4.h:246
mat4< T > & operator*=(const mat4< T > &rhs)
Definition: mat4.h:305
mat4()
Definition: mat4.h:19
mat4< T > & operator/=(const T &rhs)
Definition: mat4.h:353
mat4< T > & operator-=(const mat4< T > &rhs)
Definition: mat4.h:291
bool operator==(const mat4< T > &rhs)
Definition: mat4.h:367
static mat4< T > Transformation(const mat3< T > &m)
Definition: mat4.h:107
friend mat4< T > operator/(mat4< T > lhs, const T &rhs)
Definition: mat4.h:269
T values[4][4]
loosely packed data
Definition: mat4.h:14
friend mat4< T > operator*(mat4< T > lhs, const mat4< T > &rhs)
Definition: mat4.h:261
friend mat4< T > operator*(mat4< T > lhs, const T &rhs)
Definition: mat4.h:238
bool IsSymmetric()
Definition: mat4.h:131
mat4 Inverse()
Definition: mat4.h:169
mat4< T > & operator*=(const T &rhs)
Definition: mat4.h:339
float Determinant()
Definition: mat4.h:140
const T * operator[](int index) const
Definition: mat4.h:394
bool operator!=(const mat4< T > &rhs)
Definition: mat4.h:380
mat4< T > Transpose()
Definition: mat4.h:119
T * operator[](int index)
Definition: mat4.h:388
mat3< T > getMinor(const size_t &i, const size_t &j)
Definition: mat4.h:155
friend std::ostream & operator<<(std::ostream &, const mat4< U > &)
Definition: mat4.h:407
mat4(const T &_a)
Definition: mat4.h:77
friend mat4< T > operator-(mat4< T > lhs, const mat4< T > &rhs)
Definition: mat4.h:231
friend mat4< T > operator+(mat4< T > lhs, const mat4< T > &rhs)
Definition: mat4.h:224
static mat4< T > Unit()
Definition: mat4.h:94
mat4(const T &_a, const T &_b, const T &_c, const T &_d, const T &_e, const T &_f, const T &_g, const T &_h, const T &_i, const T &_j, const T &_k, const T &_l, const T &_m, const T &_n, const T &_o, const T &_p)
Definition: mat4.h:47
mat4(const vec4< T > &A, const vec4< T > &B, const vec4< T > &C, const vec4< T > &D)
Definition: mat4.h:65