Class for working with matrix 4 x 4. Подробнее...
Открытые типы | |
typedef comms::cMat4 | mat4_t |
Открытые члены | |
Mat4 () | |
Constructor for building a zero matrix. | |
operator Quat () const | |
Ability for converting Mat4 to Quat . Подробнее... | |
operator std::string () const | |
Ability for converting Mat4 to string . Подробнее... | |
bool | operator== (const Mat4 &b) const |
Comparison. Подробнее... | |
bool | identity () const |
Returns TRUE when the matrix is identity. | |
bool | orthonormalized () const |
Returns TRUE when the matrix is ortonormal. | |
bool | symmetric () const |
Returns TRUE when the matrix is symmetric. | |
bool | zero () const |
Returns TRUE when all values of the matrix are zero. | |
Mat4 & | operator() (int row, int col, float v) |
Setter like array. Подробнее... | |
float | operator() (int row, int col) const |
Getter like array. Подробнее... | |
Mat4 & | rotation (const Angles &) |
Angles | rotation () const |
Mat4 & | scaling (const Vec3 &) |
Vec3 | scaling () const |
Mat4 & | translation (const Vec3 &) |
Vec3 | translation () const |
Mat4 | operator- () const |
Negation operator. Подробнее... | |
Mat4 & | operator+= (const Mat4 &b) |
Mat4 & | operator-= (const Mat4 &b) |
Mat4 & | operator*= (const Mat4 &b) |
Mat4 & | operator*= (const float &k) |
Mat4 & | operator/= (const float &k) |
Mat4 | operator+ (const Mat4 &b) const |
Mat4 | operator- (const Mat4 &b) const |
Mat4 | operator* (const Mat4 &b) const |
Mat4 | operator* (const float &k) const |
Mat4 | operator/ (const float &k) const |
float | determinant () const |
Returns determinant of the matrix. Подробнее... | |
float | trace () const |
Returns trace of the matrix. Подробнее... | |
Mat4 & | invert () |
Invert the matrix. Подробнее... | |
Mat4 | invertCopy () const |
Mat4 & | transpose () |
Transpose the matrix. Подробнее... | |
Mat4 | transposeCopy () const |
Статические открытые данные | |
static const Mat4 | IDENTITY |
static const Mat4 | ZERO |
Class for working with matrix 4 x 4.
Mat4 a(
1, 0, 0, 10,
0, 2, 0, 30,
0, 0, 6, 90,
0, 0, 0, 1 );
Mat4 b = {
1, 0, 0, 10,
0, 2, 0, 30,
0, 0, 6, 90,
0, 0, 0, 1 };
Vec3 scaling( 1, 2, 6 );
Vec3 translation( 10, 30, 90 );
Mat4 a( scaling, translation );
Mat4 a( 0 );
// equivalent to
Mat4 b( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 );
// equivalent to
Mat4 c = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
coat::scripto::Mat4::operator Quat | ( | ) | const |
coat::scripto::Mat4::operator std::string | ( | ) | const |
Ability for converting Mat4
to string
.
Mat4 a = {
1, 0, 0, 10,
0, 2, 0, 30,
0, 0, 6, 90,
0, 0, 0, 1 };
auto m = string( a );
|
inline |
Comparison.
Mat4 a;
...
if (a == Mat4( 1 )) { ... }
|
inline |
Setter like array.
Mat4 a( 0 );
// setting a value 9.5 to row 3 and col 2
a[ 3, 2, 9.5 ];
|
inline |
Getter like array.
Mat4 a = {
1, 0, 0, 10,
0, 2, 0, 30,
0, 0, 6, 90,
0, 0, 0, 1 };
float v00 = a[ 0, 0 ];
float v32 = a[ 3, 2 ];
|
inline |
Negation operator.
Mat4 a( 1 );
Mat4 na = -a;
|
inline |
Returns determinant of the matrix.
Mat4 a( 1 );
float r = a.determinant();
|
inline |
Returns trace of the matrix.
Mat4 a = {
1, 0, 0, 10,
0, 2, 0, 30,
0, 0, 6, 90,
0, 0, 0, 1 };
float r = a.trace();
|
inline |
Invert the matrix.
Mat4 a = {
1, 0, 0, 10,
0, 2, 0, 30,
0, 0, 6, 90,
0, 0, 0, 1 };
a.invert();
|
inline |
Transpose the matrix.
Mat4 a = {
1, 0, 0, 10,
0, 2, 0, 30,
0, 0, 6, 90,
0, 0, 0, 1 };
a.transpose();
|
inline |