36#include "../System/cl_platform.h" 
   44        template<
typename Type>
 
   47        template<
typename Type>
 
   50        template<
typename Type>
 
   58        template<
typename Type>
 
   65                        for (
int i = 0; 
i < 9; 
i++)
 
 
   72                        for (
int i = 0; 
i < 9; 
i++)
 
 
   83                explicit Mat3(
const float *init_matrix)
 
   85                        for (
int i = 0; 
i < 9; 
i++)
 
 
   90                explicit Mat3(Type m00, Type m01, Type m02, Type m10, Type m11, Type m12, Type m20, Type m21, Type m22)
 
 
   98                explicit Mat3(
const double *init_matrix)
 
  100                        for (
int i = 0; 
i < 9; 
i++)
 
 
  105                explicit Mat3(
const int64_t *init_matrix)
 
  107                        for (
int i = 0; 
i < 9; 
i++)
 
 
  112                explicit Mat3(
const int32_t *init_matrix)
 
  114                        for (
int i = 0; 
i < 9; 
i++)
 
 
  119                explicit Mat3(
const int16_t *init_matrix)
 
  121                        for (
int i = 0; 
i < 9; 
i++)
 
 
  126                explicit Mat3(
const int8_t *init_matrix)
 
  128                        for (
int i = 0; 
i < 9; 
i++)
 
 
  156                        return rotate(
angle, rotation.
x, rotation.
y, rotation.
z, normalize);
 
 
  261                        for (
int i = 0; 
i < 9; 
i++)
 
  263                                Type diff = second.matrix[
i] - first.matrix[
i];
 
  264                                if (diff < -epsilon || diff > epsilon) 
return false;
 
 
  297                operator Type 
const*() 
const { 
return matrix; }
 
  338                        for (
int i = 0; 
i < 9; 
i++)
 
  339                                if (
matrix[
i] != other.matrix[
i]) 
return false;
 
 
  347        template<
typename Type>
 
  350        template<
typename Type>
 
  353        template<
typename Type>
 
  356        template<
typename Type>
 
  359        template<
typename Type>
 
  362        template<
typename Type>
 
 
  365        template<
typename Type>
 
  368        template<
typename Type>
 
 
 
 
 
 
 
 
Angle class.
Definition angle.h:60
2D matrix
Definition vec4.h:52
3D matrix
Definition vec4.h:55
static Mat3< Type > rotate(const Angle &angle, Vec3< Type > rotation, bool normalize=true)
Create a 3d rotation matrix.
Definition mat3.h:154
bool operator==(const Mat3< Type > &other) const
Equality operator.
Definition mat3.h:336
double det() const
Calculate the matrix determinant.
static Mat3< Type > rotate(const Angle &angle)
Create a 2d rotation 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)
Definition mat3.h:90
Mat3< Type > & transpose()
Calculate the transpose of this matrix.
bool operator!=(const Mat3< Type > &other)
Not-equal operator.
Definition mat3.h:344
static Mat3< Type > scale(Type x, Type y)
Create a 2d scale matrix.
Type matrix[9]
The matrix (in column-major format)
Definition mat3.h:270
const Type & operator[](unsigned int i) const
Operator that returns the matrix cell at the given index.
Definition mat3.h:312
static Mat3< Type > translate(const Vec2< Type > &xy)
Create a 2d translation matrix.
Definition mat3.h:202
Type & operator[](unsigned int i)
Operator that returns the matrix cell at the given index.
Definition mat3.h:309
static bool is_equal(const Mat3< Type > &first, const Mat3< Type > &second, Type epsilon)
Returns true if equal within the bounds of an epsilon.
Definition mat3.h:259
Mat3< Type > operator-(const Mat3< Type > &sub_matrix) const
Subtraction operator.
Mat3(const Mat4< Type > ©)
Constructs a 3x3 matrix (copied from a 4d matrix)
Mat3< Type > operator*(const Mat3< Type > &mult) const
Multiplication operator.
Mat3< Type > operator+(const Mat3< Type > &add_matrix) const
Addition operator.
Mat3< Type > & operator=(const Mat3< Type > ©)
Copy assignment operator.
Definition mat3.h:315
Mat3(const float *init_matrix)
Constructs a 3x3 matrix (copied from 9 floats)
Definition mat3.h:83
Mat3()
Constructs a 3x3 matrix (zero'ed)
Definition mat3.h:63
Mat3(const int8_t *init_matrix)
Constructs a 3x3 matrix (copied from 9, 8 bit integers)
Definition mat3.h:126
const Type & operator[](int i) const
Operator that returns the matrix cell at the given index.
Definition mat3.h:306
static Mat3< Type > translate(Type x, Type y)
Create a 2d translation matrix.
Mat3(const Mat3< Type > ©)
Constructs a 3x3 matrix (copied)
Definition mat3.h:70
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.
Mat3(const int32_t *init_matrix)
Constructs a 3x3 matrix (copied from 9, 32 bit integers)
Definition mat3.h:112
bool is_equal(const Mat3< Type > &other, Type epsilon) const
Returns true if equal within the bounds of an epsilon.
Definition mat3.h:294
Mat3< Type > & inverse()
Create the matrix inverse. (Returns a zero matrix if the determinent = 0)
Mat3< Type > & adjoint()
Creates the adjoint (or known as adjugate) of the matrix.
Mat3(const int64_t *init_matrix)
Constructs a 3x3 matrix (copied from 9, 64 bit integers)
Definition mat3.h:105
Mat3(const int16_t *init_matrix)
Constructs a 3x3 matrix (copied from 9, 16 bit integers)
Definition mat3.h:119
static Mat3< Type > scale(const Vec3< Type > &xy)
Create a 2d scale matrix.
Definition mat3.h:184
Mat3(const double *init_matrix)
Constructs a 3x3 matrix (copied from 9 doubles)
Definition mat3.h:98
static Mat3< Type > rotate(const Angle &angle, Type x, Type y, Type z, bool normalize=true)
Create a 3d rotation matrix.
Type & operator[](int i)
Operator that returns the matrix cell at the given index.
Definition mat3.h:303
Mat3(const Mat2< Type > ©)
Constructs a 3x3 matrix (copied from a 2d matrix)
4D matrix
Definition vec4.h:58
2D vector
Definition vec4.h:43
Type y
Definition vec2.h:81
Type x
Definition vec2.h:80
3D vector
Definition vec4.h:46
Type z
Definition vec3.h:81
Type y
Definition vec3.h:80
Type x
Definition vec3.h:79
Mat3< double > Mat3d
Definition mat3.h:373
static Mat3< Type > transpose(const Mat3< Type > &matrix)
Calculate the transpose of a matrix.
Definition mat3.h:363
static Mat3< Type > multiply(const Mat3< Type > &matrix_1, const Mat3< Type > &matrix_2)
Multiply 2 matrices.
Definition mat3.h:348
Mat3< float > Mat3f
Definition mat3.h:372
static Mat3< Type > adjoint(const Mat3< Type > &matrix)
Calculate the adjoint (or known as Adjugate or Conjugate Transpose) of a matrix.
Definition mat3.h:357
static Mat3< Type > subtract(const Mat3< Type > &matrix_1, const Mat3< Type > &matrix_2)
Subtract 2 matrices.
Definition mat3.h:354
Mat3< int > Mat3i
Definition mat3.h:371
static Mat3< Type > add(const Mat3< Type > &matrix_1, const Mat3< Type > &matrix_2)
Add 2 matrices.
Definition mat3.h:351
static Mat3< Type > null()
Definition mat3.h:366
EulerOrder
Euler angle rotation order.
Definition angle.h:49
static Mat3< Type > identity()
Definition mat3.h:369
static Mat3< Type > inverse(const Mat3< Type > &matrix)
Calculate the matrix inverse of a matrix.
Definition mat3.h:360