2D matrix More...
#include <mat2.h>
Public Member Functions | |
Mat2 () | |
Constructs a 2x2 matrix (zero'ed) More... | |
Mat2 (const Mat2< Type > ©) | |
Constructs a 2x2 matrix (copied) More... | |
Mat2 (const Mat3< Type > ©) | |
Constructs a 2x2 matrix (copied from a 3d matrix) More... | |
Mat2 (const Mat4< Type > ©) | |
Constructs a 2x2 matrix (copied from a 4d matrix) More... | |
Mat2 (const float *init_matrix) | |
Constructs a 2x2 matrix (copied from 4 floats) More... | |
Mat2 (Type m00, Type m01, Type m10, Type m11) | |
Constructs a 2x2 matrix (copied from specified values) More... | |
Mat2 (const double *init_matrix) | |
Constructs a 2x2 matrix (copied from 4 doubles) More... | |
Mat2 (const int64_t *init_matrix) | |
Constructs a 2x2 matrix (copied from 4, 64 bit integers) More... | |
Mat2 (const int32_t *init_matrix) | |
Constructs a 2x2 matrix (copied from 4, 32 bit integers) More... | |
Mat2 (const int16_t *init_matrix) | |
Constructs a 2x2 matrix (copied from 4, 16 bit integers) More... | |
Mat2 (const int8_t *init_matrix) | |
Constructs a 2x2 matrix (copied from 4, 8 bit integers) More... | |
bool | is_equal (const Mat2< 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 Mat2< Type > &other) const |
Not-equal operator. More... | |
Mat2< Type > | operator* (const Mat2< Type > &mult) const |
Multiplication operator. More... | |
Mat2< Type > | operator+ (const Mat2< Type > &add_matrix) const |
Addition operator. More... | |
Mat2< Type > | operator- (const Mat2< Type > &subtract_matrix) const |
Subtract operator. More... | |
Mat2< Type > & | operator= (const Mat2< Type > ©) |
Copy assignment operator. More... | |
Mat2< Type > & | operator= (const Mat4< Type > ©) |
Copy assignment operator. More... | |
Mat2< Type > & | operator= (const Mat3< Type > ©) |
Copy assignment operator. More... | |
bool | operator== (const Mat2< 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... | |
Static Public Member Functions | |
static Mat2< Type > | add (const Mat2< Type > &matrix_1, const Mat2< Type > &matrix_2) |
Add 2 matrices. More... | |
static Mat2< Type > | identity () |
static bool | is_equal (const Mat2< Type > &first, const Mat2< Type > &second, Type epsilon) |
Returns true if equal within the bounds of an epsilon. More... | |
static Mat2< Type > | multiply (const Mat2< Type > &matrix_1, const Mat2< Type > &matrix_2) |
Multiply 2 matrices. More... | |
static Mat2< Type > | null () |
static Mat2< Type > | subtract (const Mat2< Type > &matrix_1, const Mat2< Type > &matrix_2) |
Subtract 2 matrices. More... | |
Public Attributes | |
Type | matrix [4] |
The matrix (in column-major format) More... | |
2D matrix
These matrix templates are defined for: int (Mat2i), float (Mat2f), double (Mat2d)
|
inline |
Constructs a 2x2 matrix (zero'ed)
References uicore::Mat2< Type >::matrix.
|
inline |
Constructs a 2x2 matrix (copied)
References uicore::i, and uicore::Mat2< Type >::matrix.
|
explicit |
Constructs a 2x2 matrix (copied from a 3d matrix)
|
explicit |
Constructs a 2x2 matrix (copied from a 4d matrix)
|
inlineexplicit |
Constructs a 2x2 matrix (copied from 4 floats)
References uicore::i, and uicore::Mat2< Type >::matrix.
|
inlineexplicit |
Constructs a 2x2 matrix (copied from specified values)
References uicore::Mat2< Type >::matrix.
|
inlineexplicit |
Constructs a 2x2 matrix (copied from 4 doubles)
References uicore::i, and uicore::Mat2< Type >::matrix.
|
inlineexplicit |
Constructs a 2x2 matrix (copied from 4, 64 bit integers)
References uicore::i, and uicore::Mat2< Type >::matrix.
|
inlineexplicit |
Constructs a 2x2 matrix (copied from 4, 32 bit integers)
References uicore::i, and uicore::Mat2< Type >::matrix.
|
inlineexplicit |
Constructs a 2x2 matrix (copied from 4, 16 bit integers)
References uicore::i, and uicore::Mat2< Type >::matrix.
|
inlineexplicit |
Constructs a 2x2 matrix (copied from 4, 8 bit integers)
References uicore::i, and uicore::Mat2< Type >::matrix.
|
static |
Add 2 matrices.
This adds the matrix as follows: result = matrix1 + matrix2
matrix_1 | = First Matrix to add |
matrix_2 | = Second Matrix to add |
|
static |
|
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) |
References uicore::i, and uicore::Mat2< Type >::matrix.
Referenced by uicore::Mat2< Type >::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) |
References uicore::Mat2< Type >::is_equal().
|
static |
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 |
|
static |
|
inline |
Operator that returns the matrix as a array.
References uicore::Mat2< Type >::matrix.
|
inline |
Operator that returns the matrix as a array.
References uicore::Mat2< Type >::matrix.
|
inline |
Not-equal operator.
Mat2<Type> uicore::Mat2< Type >::operator* | ( | const Mat2< Type > & | mult | ) | const |
Multiplication operator.
Mat2<Type> uicore::Mat2< Type >::operator+ | ( | const Mat2< Type > & | add_matrix | ) | const |
Addition operator.
Mat2<Type> uicore::Mat2< Type >::operator- | ( | const Mat2< Type > & | subtract_matrix | ) | const |
Subtract operator.
|
inline |
Copy assignment operator.
References uicore::Mat2< Type >::matrix.
Mat2<Type>& uicore::Mat2< Type >::operator= | ( | const Mat4< Type > & | copy | ) |
Copy assignment operator.
Mat2<Type>& uicore::Mat2< Type >::operator= | ( | const Mat3< Type > & | copy | ) |
Copy assignment operator.
|
inline |
Equality operator.
References uicore::i, and uicore::Mat2< Type >::matrix.
|
inline |
Operator that returns the matrix cell at the given index.
References uicore::i.
|
inline |
Operator that returns the matrix cell at the given index.
References uicore::i.
|
inline |
Operator that returns the matrix cell at the given index.
References uicore::i.
|
inline |
Operator that returns the matrix cell at the given index.
References uicore::i.
|
static |
Subtract 2 matrices.
This subtract the matrix as follows: result = matrix1 - matrix2
matrix_1 | = First Matrix to subtract |
matrix_2 | = Second Matrix to subtract |
Type uicore::Mat2< Type >::matrix[4] |
The matrix (in column-major format)
Referenced by uicore::Mat2< Type >::is_equal(), uicore::Mat2< Type >::Mat2(), uicore::Mat2< Type >::operator Type *(), uicore::Mat2< Type >::operator Type const *(), uicore::Mat2< Type >::operator=(), uicore::Mat2< Type >::operator==(), and uicore::ProgramObject::set_uniform_matrix().