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