SA_Maths
Sapphire Suite's C++ Maths Library
|
Matrix 3x3 Sapphire-Maths class. More...
#include <Matrix3.hpp>
Public Member Functions | |
template<typename TIn , MatrixMajor majorIn> | |
constexpr | Mat3 (const Mat3< TIn, majorIn > &_other) noexcept |
Value constructor from another Mat3 type. | |
template<typename TIn , MatrixMajor majorIn> | |
constexpr | Mat3 (const Mat4< TIn, majorIn > &_other) noexcept |
Value constructor from another Mat4 type. | |
constexpr bool | IsZero () const noexcept |
Whether this matrix is a zero matrix. | |
constexpr bool | IsIdentity () const noexcept |
Whether this matrix is an identity matrix. | |
constexpr bool | Equals (const Mat3 &_other, T _epsilon=std::numeric_limits< T >::epsilon()) const noexcept |
Compare 2 Matrix. | |
constexpr bool | operator== (const Mat3 &_rhs) const noexcept |
Compare 2 matrix equality. | |
constexpr bool | operator!= (const Mat3 &_rhs) const noexcept |
Compare 2 matrix inequality. | |
T * | Data () noexcept |
Getter of matrix data | |
const T * | Data () const noexcept |
Const Getter of matrix data | |
T & | At (uint32_t _index) |
Getter of Value at index. | |
const T & | At (uint32_t _index) const |
Const Getter of Value at index. | |
T & | At (uint32_t _x, uint32_t _y) |
Getter of Value at (x;y). | |
const T & | At (uint32_t _x, uint32_t _y) const |
Const Getter of Value at (x;y). | |
T & | operator[] (uint32_t _index) |
Access operator by index. | |
const T & | operator[] (uint32_t _index) const |
Const Access operator by index. | |
Mat3 & | Transpose () noexcept |
Transpose this matrix. | |
constexpr Mat3 | GetTransposed () const noexcept |
Transpose this matrix. | |
T | Determinant () const noexcept |
Compute the determinant of the matrix. | |
Mat3 & | Inverse () |
Inverse this matrix. | |
Mat3 | GetInversed () const |
Inverse this matrix. | |
template<typename TIn , MatrixMajor majorIn> | |
Mat3 & | operator= (const Mat3< TIn, majorIn > _rhs) noexcept |
Assignment operator from another Mat3 type. | |
constexpr Mat3 | operator- () const noexcept |
Getter of the opposite signed matrix. | |
template<typename TIn > | |
Mat3 | operator* (TIn _scale) const noexcept |
Scale each matrix component by _scale. | |
template<typename TIn > | |
Mat3 | operator/ (TIn _scale) const |
Inverse Scale each matrix component by _scale. | |
Mat3 | operator+ (const Mat3 &_rhs) const noexcept |
Add term by term matrix values. | |
Mat3 | operator- (const Mat3 &_rhs) const noexcept |
Subtract term by term matrix values. | |
Mat3 | operator* (const Mat3 &_rhs) const noexcept |
Multiply matrices. | |
Mat3 | operator/ (const Mat3 &_rhs) const |
Inverse multiply matrices. | |
Vec3< T > | operator* (const Vec3< T > &_rhs) const noexcept |
transform this vector by this matrix. | |
template<typename TIn > | |
Mat3 & | operator*= (TIn _scale) noexcept |
Scale each matrix component by _scale. | |
template<typename TIn > | |
Mat3 & | operator/= (TIn _scale) |
Inverse Scale each matrix component by _scale. | |
Mat3 & | operator+= (const Mat3 &_rhs) noexcept |
Add term by term matrix values. | |
Mat3 & | operator-= (const Mat3 &_rhs) noexcept |
Subtract term by term matrix values. | |
Mat3 & | operator*= (const Mat3 &_rhs) noexcept |
Multiply matrices. | |
Mat3 & | operator/= (const Mat3 &_rhs) |
Inverse multiply matrices. | |
Static Public Member Functions | |
static Mat3 | Lerp (const Mat3 &_start, const Mat3 &_end, float _alpha) noexcept |
Clamped Lerp from _start to _end at _alpha. | |
static Mat3 | LerpUnclamped (const Mat3 &_start, const Mat3 &_end, float _alpha) noexcept |
Unclamped Lerp from _start to _end at _alpha. | |
static Mat3 | MakeRotation (const Quat< T > &_rot) noexcept |
Make rotation matrix from quaternion. | |
static Mat3 | MakeScale (const Vec3< T > &_scale) noexcept |
Make scale matrix from vector3. | |
Static Public Attributes | |
static const Mat3 | Zero |
Zero Mat3 constant. | |
static const Mat3 | Identity |
Identity Mat3 constant. | |
Matrix 3x3 Sapphire-Maths class.
must be align at 32 for intrinsics.
T | Type of the matrix. |
|
constexprnoexcept |
|
constexprnoexcept |
T & SA::Mat3< T, major >::At | ( | uint32_t | _index | ) |
Getter of Value at index.
[in] | _index | Index to access. |
const T & SA::Mat3< T, major >::At | ( | uint32_t | _index | ) | const |
Const Getter of Value at index.
[in] | _index | Index to access. |
T & SA::Mat3< T, major >::At | ( | uint32_t | _x, |
uint32_t | _y ) |
Getter of Value at (x;y).
[in] | _x | row index. |
[in] | _y | column index. |
const T & SA::Mat3< T, major >::At | ( | uint32_t | _x, |
uint32_t | _y ) const |
Const Getter of Value at (x;y).
[in] | _x | row index. |
[in] | _y | column index. |
|
noexcept |
Const Getter of matrix data
|
noexcept |
Getter of matrix data
|
noexcept |
Compute the determinant of the matrix.
|
constexprnoexcept |
Compare 2 Matrix.
[in] | _other | Other matrix to compare to. |
[in] | _epsilon | Epsilon value for threshold comparison. |
Mat3 SA::Mat3< T, major >::GetInversed | ( | ) | const |
Inverse this matrix.
|
constexprnoexcept |
Transpose this matrix.
Mat3 & SA::Mat3< T, major >::Inverse | ( | ) |
Inverse this matrix.
|
constexprnoexcept |
Whether this matrix is an identity matrix.
|
constexprnoexcept |
Whether this matrix is a zero matrix.
|
staticnoexcept |
Clamped Lerp from _start to _end at _alpha.
Reference: https://en.wikipedia.org/wiki/Linear_interpolation
_start | Starting point of the lerp. |
_end | Ending point of the lerp. |
_alpha | Alpha of the lerp. |
|
staticnoexcept |
Unclamped Lerp from _start to _end at _alpha.
Reference: https://en.wikipedia.org/wiki/Linear_interpolation
_start | Starting point of the lerp. |
_end | Ending point of the lerp. |
_alpha | Alpha of the lerp. |
|
staticnoexcept |
Make rotation matrix from quaternion.
[in] | _rot | quaternion to use for rotation. |
|
staticnoexcept |
Make scale matrix from vector3.
[in] | _scale | Vector for scaling. |
|
constexprnoexcept |
Compare 2 matrix inequality.
[in] | _rhs | Other matrix to compare to. |
|
noexcept |
Multiply matrices.
[in] | _rhs | Matrix to multiply to. |
|
noexcept |
transform this vector by this matrix.
[in] | _rhs | Vector to transform. |
|
noexcept |
Scale each matrix component by _scale.
TIn | Type of the input scale. |
[in] | _scale | Scale value to apply on all components. |
|
noexcept |
Multiply matrices.
[in] | _rhs | Matrix to multiply to. |
|
noexcept |
Scale each matrix component by _scale.
TIn | Type of the input scale. |
[in] | _scale | Scale value to apply on all components. |
|
noexcept |
Add term by term matrix values.
[in] | _rhs | Matrix to add. |
|
noexcept |
Add term by term matrix values.
[in] | _rhs | Matrix to add. |
|
constexprnoexcept |
Getter of the opposite signed matrix.
|
noexcept |
Subtract term by term matrix values.
[in] | _rhs | Matrix to substract. |
|
noexcept |
Subtract term by term matrix values.
[in] | _rhs | Matrix to substract. |
Mat3 SA::Mat3< T, major >::operator/ | ( | const Mat3< T, major > & | _rhs | ) | const |
Inverse multiply matrices.
[in] | _rhs | Matrix to inverse multiply to. |
Mat3 SA::Mat3< T, major >::operator/ | ( | TIn | _scale | ) | const |
Inverse Scale each matrix component by _scale.
TIn | Type of the input scale. |
[in] | _scale | Inverse scale value to apply on all components. |
Mat3 & SA::Mat3< T, major >::operator/= | ( | const Mat3< T, major > & | _rhs | ) |
Inverse multiply matrices.
[in] | _rhs | Matrix to inverse multiply to. |
Mat3 & SA::Mat3< T, major >::operator/= | ( | TIn | _scale | ) |
Inverse Scale each matrix component by _scale.
TIn | Type of the input scale. |
[in] | _scale | Inverse scale value to apply on all components. |
|
noexcept |
|
constexprnoexcept |
Compare 2 matrix equality.
[in] | _rhs | Other matrix to compare to. |
T & SA::Mat3< T, major >::operator[] | ( | uint32_t | _index | ) |
Access operator by index.
[in] | _index | Index to access. |
const T & SA::Mat3< T, major >::operator[] | ( | uint32_t | _index | ) | const |
Const Access operator by index.
[in] | _index | Index to access. |
|
noexcept |
Transpose this matrix.
|
static |
Identity Mat3 constant.
{1, 0, 0} {0, 1, 0} {0, 0, 1}
|
static |
Zero Mat3 constant.
{0, 0, 0} {0, 0, 0} {0, 0, 0}