3D matrix More...
#include <mat2.h>
Public Member Functions | |
Mat3 () | |
Constructs a 3x3 matrix (zero'ed) More... | |
Mat3 (const Mat3< Type > ©) | |
Constructs a 3x3 matrix (copied) More... | |
Mat3 (const Mat2< Type > ©) | |
Constructs a 3x3 matrix (copied from a 2d matrix) More... | |
Mat3 (const Mat4< Type > ©) | |
Constructs a 3x3 matrix (copied from a 4d matrix) More... | |
Mat3 (const float *init_matrix) | |
Constructs a 3x3 matrix (copied from 9 floats) More... | |
Mat3 (Type m00, Type m01, Type m02, Type m10, Type m11, Type m12, Type m20, Type m21, Type m22) | |
Constructs a 3x3 matrix (copied from specified values) More... | |
Mat3 (const double *init_matrix) | |
Constructs a 3x3 matrix (copied from 9 doubles) More... | |
Mat3 (const int64_t *init_matrix) | |
Constructs a 3x3 matrix (copied from 9, 64 bit integers) More... | |
Mat3 (const int32_t *init_matrix) | |
Constructs a 3x3 matrix (copied from 9, 32 bit integers) More... | |
Mat3 (const int16_t *init_matrix) | |
Constructs a 3x3 matrix (copied from 9, 16 bit integers) More... | |
Mat3 (const int8_t *init_matrix) | |
Constructs a 3x3 matrix (copied from 9, 8 bit integers) More... | |
Mat3< Type > & | adjoint () |
Creates the adjoint (or known as adjugate) of the matrix. More... | |
double | det () const |
Calculate the matrix determinant. More... | |
Mat3< Type > & | inverse () |
Create the matrix inverse. (Returns a zero matrix if the determinent = 0) More... | |
bool | is_equal (const Mat3< Type > &other, Type epsilon) const |
Returns true if equal within the bounds of an epsilon. More... | |
operator Type * () | |
Operator that returns the matrix as a array. More... | |
operator Type const * () const | |
Operator that returns the matrix as a array. More... | |
bool | operator!= (const Mat3< Type > &other) |
Not-equal operator. More... | |
Mat3< Type > | operator* (const Mat3< Type > &mult) const |
Multiplication operator. More... | |
Vec2< Type > | operator* (const Vec2< Type > &mult) const |
Multiplication operator. More... | |
Mat3< Type > | operator+ (const Mat3< Type > &add_matrix) const |
Addition operator. More... | |
Mat3< Type > | operator- (const Mat3< Type > &sub_matrix) const |
Subtraction operator. More... | |
Mat3< Type > & | operator= (const Mat3< Type > ©) |
Copy assignment operator. More... | |
Mat3< Type > & | operator= (const Mat4< Type > ©) |
Copy assignment operator. More... | |
Mat3< Type > & | operator= (const Mat2< Type > ©) |
Copy assignment operator. More... | |
bool | operator== (const Mat3< Type > &other) const |
Equality operator. More... | |
Type & | operator[] (int i) |
Operator that returns the matrix cell at the given index. More... | |
const Type & | operator[] (int i) const |
Operator that returns the matrix cell at the given index. More... | |
Type & | operator[] (unsigned int i) |
Operator that returns the matrix cell at the given index. More... | |
const Type & | operator[] (unsigned int i) const |
Operator that returns the matrix cell at the given index. More... | |
Mat3< Type > & | transpose () |
Calculate the transpose of this matrix. More... | |
Static Public Member Functions | |
static Mat3< Type > | add (const Mat3< Type > &matrix_1, const Mat3< Type > &matrix_2) |
Add 2 matrices. More... | |
static Mat3< Type > | adjoint (const Mat3< Type > &matrix) |
Calculate the adjoint (or known as Adjugate or Conjugate Transpose) of a matrix. More... | |
static Mat3< Type > | identity () |
static Mat3< Type > | inverse (const Mat3< Type > &matrix) |
Calculate the matrix inverse of a matrix. More... | |
static bool | is_equal (const Mat3< Type > &first, const Mat3< Type > &second, Type epsilon) |
Returns true if equal within the bounds of an epsilon. More... | |
static Mat3< Type > | multiply (const Mat3< Type > &matrix_1, const Mat3< Type > &matrix_2) |
Multiply 2 matrices. More... | |
static Mat3< Type > | null () |
static Mat3< Type > | rotate (Type angle, Type x, Type y, Type z, bool normalize=true) |
Create a 3d rotation matrix. More... | |
static Mat3< Type > | rotate (float angle, Vec3< Type > rotation, bool normalize=true) |
Create a 3d rotation matrix. More... | |
static Mat3< Type > | rotate (Type angle_x, Type angle_y, Type angle_z, EulerOrder order) |
Create a 3d rotation matrix using euler angles. More... | |
static Mat3< Type > | rotate (Type angle) |
Create a 2d rotation matrix. More... | |
static Mat3< Type > | scale (Type x, Type y) |
Create a 2d scale matrix. More... | |
static Mat3< Type > | scale (const Vec3< Type > &xy) |
Create a 2d scale matrix. More... | |
static Mat3< Type > | subtract (const Mat3< Type > &matrix_1, const Mat3< Type > &matrix_2) |
Subtract 2 matrices. More... | |
static Mat3< Type > | translate (Type x, Type y) |
Create a 2d translation matrix. More... | |
static Mat3< Type > | translate (const Vec2< Type > &xy) |
Create a 2d translation matrix. More... | |
static Mat3< Type > | transpose (const Mat3< Type > &matrix) |
Calculate the transpose of a matrix. More... | |
Public Attributes | |
Type | matrix [9] |
The matrix (in column-major format) More... | |
3D matrix
These matrix templates are defined for: int (Mat3i), float (Mat3f), double (Mat3d)
|
inline |
Constructs a 3x3 matrix (zero'ed)
|
inline |
Constructs a 3x3 matrix (copied)
|
explicit |
Constructs a 3x3 matrix (copied from a 2d matrix)
|
explicit |
Constructs a 3x3 matrix (copied from a 4d matrix)
|
inlineexplicit |
Constructs a 3x3 matrix (copied from 9 floats)
|
inlineexplicit |
Constructs a 3x3 matrix (copied from specified values)
|
inlineexplicit |
Constructs a 3x3 matrix (copied from 9 doubles)
|
inlineexplicit |
Constructs a 3x3 matrix (copied from 9, 64 bit integers)
|
inlineexplicit |
Constructs a 3x3 matrix (copied from 9, 32 bit integers)
|
inlineexplicit |
Constructs a 3x3 matrix (copied from 9, 16 bit integers)
|
inlineexplicit |
Constructs a 3x3 matrix (copied from 9, 8 bit integers)
|
inlinestatic |
Add 2 matrices.
This adds the matrix as follows: result = matrix1 + matrix2
matrix_1 | = First Matrix to add |
matrix_2 | = Second Matrix to add |
|
inlinestatic |
Calculate the adjoint (or known as Adjugate or Conjugate Transpose) of a matrix.
matrix | = The matrix to use |
Mat3<Type>& uicore::Mat3< Type >::adjoint | ( | ) |
Creates the adjoint (or known as adjugate) of the matrix.
double uicore::Mat3< Type >::det | ( | ) | const |
Calculate the matrix determinant.
|
inlinestatic |
References uicore::m, and uicore::null.
|
inlinestatic |
Calculate the matrix inverse of a matrix.
Creates a zero matrix if the determinent == 0
matrix | = The matrix to use |
Mat3<Type>& uicore::Mat3< Type >::inverse | ( | ) |
Create the matrix inverse. (Returns a zero matrix if the determinent = 0)
|
inlinestatic |
Returns true if equal within the bounds of an epsilon.
first | = Value A |
second | = Value B |
epsilon | = The epsilon (eg FLT_EPSILON/2, DBL_EPSILON/2) |
Referenced by uicore::Mat3< float >::is_equal().
|
inline |
Returns true if equal within the bounds of an epsilon.
other | = Other value |
epsilon | = The epsilon (eg FLT_EPSILON/2, DBL_EPSILON/2) |
|
inlinestatic |
Multiply 2 matrices.
This multiplies the matrix as follows: result = matrix1 * matrix2
Matrix is multiplied in the Column-Major matrix format (opengl native)
matrix_1 | = First Matrix to multiply |
matrix_2 | = Second Matrix to multiply |
|
inlinestatic |
References uicore::m.
|
inline |
Operator that returns the matrix as a array.
References uicore::Mat3< Type >::matrix.
|
inline |
Operator that returns the matrix as a array.
References uicore::Mat3< Type >::matrix.
|
inline |
Not-equal operator.
Mat3<Type> uicore::Mat3< Type >::operator* | ( | const Mat3< Type > & | mult | ) | const |
Multiplication operator.
Vec2<Type> uicore::Mat3< Type >::operator* | ( | const Vec2< Type > & | mult | ) | const |
Multiplication operator.
Mat3<Type> uicore::Mat3< Type >::operator+ | ( | const Mat3< Type > & | add_matrix | ) | const |
Addition operator.
Mat3<Type> uicore::Mat3< Type >::operator- | ( | const Mat3< Type > & | sub_matrix | ) | const |
Subtraction operator.
|
inline |
Copy assignment operator.
Mat3<Type>& uicore::Mat3< Type >::operator= | ( | const Mat4< Type > & | copy | ) |
Copy assignment operator.
Mat3<Type>& uicore::Mat3< Type >::operator= | ( | const Mat2< Type > & | copy | ) |
Copy assignment operator.
|
inline |
Equality operator.
|
inline |
Operator that returns the matrix cell at the given index.
|
inline |
Operator that returns the matrix cell at the given index.
|
inline |
Operator that returns the matrix cell at the given index.
|
inline |
Operator that returns the matrix cell at the given index.
|
static |
Create a 3d rotation matrix.
Matrix is created in the Column-Major matrix format (opengl native)
angle | = Angle to rotate by in radians |
x | = Amount to rotate in the X axis |
y | = Amount to rotate in the Y axis |
z | = Amount to rotate in the Z axis |
normalize | = true = Normalize x,y,z before creating rotation matrix |
Referenced by uicore::Mat3< float >::rotate().
|
inlinestatic |
Create a 3d rotation matrix.
Matrix is created in the Column-Major matrix format (opengl native)
angle | = Angle to rotate by in radians |
rotation | = Amount to rotate in the XYZ axes |
normalize | = true = Normalize x,y,z before creating rotation matrix |
|
static |
Create a 3d rotation matrix using euler angles.
Matrix is created in the Column-Major matrix format (opengl native)
|
static |
Create a 2d rotation matrix.
Matrix is created in the Column-Major matrix format (opengl native)
angle | = Angle to rotate by in radians |
|
static |
Create a 2d scale matrix.
x | = Scale X |
y | = Scale Y |
Referenced by uicore::Mat3< float >::scale().
|
inlinestatic |
Create a 2d scale matrix.
xy | = Scale XY |
|
inlinestatic |
Subtract 2 matrices.
This subtracts the matrix as follows: result = matrix1 - matrix2
matrix_1 | = First Matrix to subtract |
matrix_2 | = Second Matrix to subtract |
|
static |
Create a 2d translation matrix.
Matrix is created in the Column-Major matrix format (opengl native)
x | = Translate X |
y | = Translate Y |
Referenced by uicore::Mat3< float >::translate().
|
inlinestatic |
Create a 2d translation matrix.
Matrix is created in the Column-Major matrix format (opengl native)
xy | = Translate XY |
|
inlinestatic |
Calculate the transpose of a matrix.
matrix | = The matrix to use |
Mat3<Type>& uicore::Mat3< Type >::transpose | ( | ) |
Calculate the transpose of this matrix.
Type uicore::Mat3< Type >::matrix[9] |
The matrix (in column-major format)
Referenced by uicore::Mat3< float >::Mat3(), uicore::Mat3< Type >::operator Type *(), uicore::Mat3< Type >::operator Type const *(), and uicore::ProgramObject::set_uniform_matrix().