4x4 generic matrix More...
#include <NRE_Matrix4x4.hpp>
Public Member Functions | |
constexpr | Matrix4x4 ()=default |
template<class A , class B , class C , class D , class E , class F , class G , class H , class I , class J , class K , class L , class M , class N , class O , class P > | |
constexpr | Matrix4x4 (A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k, L l, M m, N n, O o, P p) |
template<class K > | |
constexpr | Matrix4x4 (K value) |
template<class K , class L , class N , class M > | |
constexpr | Matrix4x4 (Vector4D< K > const &l1, Vector4D< L > const &l2, Vector4D< N > const &l3, Vector4D< M > const &l4) |
constexpr | Matrix4x4 (Matrix4x4 const &m)=default |
constexpr | Matrix4x4 (Matrix4x4 &&m)=default |
template<class K > | |
constexpr | Matrix4x4 (Matrix3x3< K > const &m) |
template<class K > | |
constexpr | Matrix4x4 (Matrix4x4< K > const &m) |
template<class K > | |
constexpr | Matrix4x4 (Quaternion< K > const &q) |
~Matrix4x4 ()=default | |
constexpr Vector4D< T > const & | getL1 () const |
constexpr Vector4D< T > const & | getL2 () const |
constexpr Vector4D< T > const & | getL3 () const |
constexpr Vector4D< T > const & | getL4 () const |
constexpr Vector4D< T > | getC1 () const |
constexpr Vector4D< T > | getC2 () const |
constexpr Vector4D< T > | getC3 () const |
constexpr Vector4D< T > | getC4 () const |
constexpr long double | getDeterminant () const |
template<class K > | |
constexpr void | setL1 (Vector4D< K > const &l1) |
template<class K > | |
constexpr void | setL2 (Vector4D< K > const &l2) |
template<class K > | |
constexpr void | setL3 (Vector4D< K > const &l3) |
template<class K > | |
constexpr void | setL4 (Vector4D< K > const &l4) |
template<class K > | |
constexpr void | setC1 (Vector4D< K > const &c1) |
template<class K > | |
constexpr void | setC2 (Vector4D< K > const &c2) |
template<class K > | |
constexpr void | setC3 (Vector4D< K > const &c3) |
template<class K > | |
constexpr void | setC4 (Vector4D< K > const &c4) |
constexpr Matrix4x4 & | setIdentity () |
constexpr Matrix4x4 & | transpose () |
constexpr Matrix4x4 & | inverse () |
template<class K > | |
constexpr Matrix4x4 & | translate (Vector3D< K > const &u) |
template<class K > | |
constexpr Matrix4x4 & | scale (Vector3D< K > const &u) |
template<class K , typename = UseIfArithmetic<K>> | |
constexpr Matrix4x4 & | stretchX (K u) |
template<class K , typename = UseIfArithmetic<K>> | |
constexpr Matrix4x4 & | stretchY (K u) |
template<class K , typename = UseIfArithmetic<K>> | |
constexpr Matrix4x4 & | stretchZ (K u) |
template<class K > | |
constexpr Matrix4x4 & | rotate (Angle angle, Vector3D< K > const &axis) |
template<class K , class L , typename = UseIfArithmetic<K>> | |
constexpr Matrix4x4 & | perspective (Angle fov, K ratio, Vector2D< L > const &z) |
template<class K , class L , class N > | |
constexpr Matrix4x4 & | ortho (Vector2D< K > const &h, Vector2D< L > const &v, Vector2D< N > const &z) |
template<class K , class L > | |
constexpr Matrix4x4 & | ortho2D (Vector2D< K > const &h, Vector2D< L > const &v) |
template<class K , class L , class N > | |
constexpr Matrix4x4 & | lookAt (Vector3D< K > const &eye, Vector3D< L > const ¢er, Vector3D< N > const &up) |
constexpr const T * | value () const |
constexpr Vector4D< T > & | operator[] (std::size_t index) |
constexpr Vector4D< T > const & | operator[] (std::size_t index) const |
constexpr Matrix4x4 & | operator= (Matrix4x4 const &m)=default |
constexpr Matrix4x4 & | operator= (Matrix4x4 &&m)=default |
template<class K > | |
constexpr Matrix4x4 & | operator= (Matrix4x4< K > const &m) |
template<class K > | |
constexpr Matrix4x4 & | operator= (Matrix4x4< K > &&m) |
template<class K > | |
constexpr Matrix4x4 & | operator+= (Matrix4x4< K > const &m) |
template<class K > | |
constexpr Matrix4x4 & | operator-= (Matrix4x4< K > const &m) |
template<class K > | |
constexpr Matrix4x4 & | operator*= (K k) |
template<class K > | |
constexpr Matrix4x4 & | operator*= (Matrix4x4< K > const &m) |
template<class K > | |
constexpr Matrix4x4 & | operator/= (K k) |
template<class K > | |
constexpr Matrix4x4 & | operator/= (Matrix4x4< K > const &m) |
template<class K > | |
constexpr Matrix4x4< std::common_type_t< T, K > > | operator+ (Matrix4x4< K > const &m) const |
template<class K > | |
constexpr Matrix4x4< std::common_type_t< T, K > > | operator- (Matrix4x4< K > const &m) const |
template<class K > | |
constexpr Matrix4x4< std::common_type_t< T, K > > | operator* (K k) const |
template<class K > | |
constexpr Matrix4x4< std::common_type_t< T, K > > | operator* (Matrix4x4< K > const &m) const |
template<class K > | |
constexpr Vector4D< K > | operator* (Vector4D< K > const &u) const |
template<class K > | |
constexpr Segment4D< K > | operator* (Segment4D< K > const &s) const |
constexpr BezierCurve4D | operator* (BezierCurve4D const &c) const |
template<class K > | |
constexpr Matrix4x4< std::common_type_t< T, K > > | operator/ (K k) const |
template<class K > | |
constexpr Matrix4x4< std::common_type_t< T, K > > | operator/ (Matrix4x4< K > const &m) const |
template<class K > | |
constexpr bool | operator== (Matrix4x4< K > const &m) const |
template<class K > | |
constexpr bool | operator!= (Matrix4x4< K > const &m) const |
Utility::String | toString () const |
Static Public Attributes | |
static constexpr Matrix4x4 | IDENTITY = Matrix4x4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1) |
4x4 generic matrix
|
default |
Default constructor
constexpr NRE::Math::Matrix4x4< T >::Matrix4x4 | ( | A | a, |
B | b, | ||
C | c, | ||
D | d, | ||
E | e, | ||
F | f, | ||
G | g, | ||
H | h, | ||
I | i, | ||
J | j, | ||
K | k, | ||
L | l, | ||
M | m, | ||
N | n, | ||
O | o, | ||
P | p | ||
) |
Construct a matrix with passed values
a | first matrix component |
b | second matrix component |
c | third matrix component |
d | fourth matrix component |
e | fifth matrix component |
f | sixth matrix component |
g | seventh matrix component |
h | eighth matrix component |
i | ninth matrix component |
j | tenth matrix component |
k | eleventh matrix component |
l | twelfth matrix component |
m | thirteenth matrix component |
n | fourteenth matrix component |
o | fifteenth matrix component |
p | sixteenth matrix component |
Construct a matrix with a unique value for all component
value | new value for all component |
constexpr NRE::Math::Matrix4x4< T >::Matrix4x4 | ( | Vector4D< K > const & | l1, |
Vector4D< L > const & | l2, | ||
Vector4D< N > const & | l3, | ||
Vector4D< M > const & | l4 | ||
) |
Construct a matrix with their lines passed in parameters with vector
l1 | the new value for the first line |
l2 | the new value for the second line |
l3 | the new value for the third line |
l4 | the new value for the fourth line |
|
default |
Copy m into this
m | the object to copy |
|
default |
Move m into this
m | the object to move |
constexpr NRE::Math::Matrix4x4< T >::Matrix4x4 | ( | Matrix3x3< K > const & | m | ) |
Convert a K-type 3x3 matrix into a T-type 4x4 matrix
m | the K-type 3x3 matrix to convert |
constexpr NRE::Math::Matrix4x4< T >::Matrix4x4 | ( | Matrix4x4< K > const & | m | ) |
Convert a K-type matrix into a T-type matrix
m | the K-type matrix to convert |
constexpr NRE::Math::Matrix4x4< T >::Matrix4x4 | ( | Quaternion< K > const & | q | ) |
Convert a K-type quaternion into a T-type matrix
q | the K-type quaternion to convert |
|
default |
Matrix4x4 Deconstructor
constexpr Vector4D<T> NRE::Math::Matrix4x4< T >::getC1 | ( | ) | const |
constexpr Vector4D<T> NRE::Math::Matrix4x4< T >::getC2 | ( | ) | const |
constexpr Vector4D<T> NRE::Math::Matrix4x4< T >::getC3 | ( | ) | const |
constexpr Vector4D<T> NRE::Math::Matrix4x4< T >::getC4 | ( | ) | const |
constexpr long double NRE::Math::Matrix4x4< T >::getDeterminant | ( | ) | const |
constexpr Vector4D<T> const& NRE::Math::Matrix4x4< T >::getL1 | ( | ) | const |
constexpr Vector4D<T> const& NRE::Math::Matrix4x4< T >::getL2 | ( | ) | const |
constexpr Vector4D<T> const& NRE::Math::Matrix4x4< T >::getL3 | ( | ) | const |
constexpr Vector4D<T> const& NRE::Math::Matrix4x4< T >::getL4 | ( | ) | const |
constexpr Matrix4x4& NRE::Math::Matrix4x4< T >::inverse | ( | ) |
Inverse the matrix, if not possible the matrix become the identity one
constexpr Matrix4x4& NRE::Math::Matrix4x4< T >::lookAt | ( | Vector3D< K > const & | eye, |
Vector3D< L > const & | center, | ||
Vector3D< N > const & | up | ||
) |
Perform a viewing transformation on this
eye | the camera's eye |
center | the point fixed by the camera |
up | the camera's up vector |
constexpr bool NRE::Math::Matrix4x4< T >::operator!= | ( | Matrix4x4< K > const & | m | ) | const |
Difference test between this and m
m | the matrix to test with this |
constexpr Matrix4x4<std::common_type_t<T, K> > NRE::Math::Matrix4x4< T >::operator* | ( | K | k | ) | const |
Compute the matrix resulting in the multiplication of this by k
k | the multiplication factor |
constexpr Matrix4x4<std::common_type_t<T, K> > NRE::Math::Matrix4x4< T >::operator* | ( | Matrix4x4< K > const & | m | ) | const |
Compute the matrix resulting in the multiplication of this and m
m | the matrix to multiply with this |
constexpr Vector4D<K> NRE::Math::Matrix4x4< T >::operator* | ( | Vector4D< K > const & | u | ) | const |
Compute the vector resulting in the transformation of u by this
u | the vector to transform |
constexpr Segment4D<K> NRE::Math::Matrix4x4< T >::operator* | ( | Segment4D< K > const & | s | ) | const |
Compute the segment resulting in the transformation of s by this
s | the segment to transform |
constexpr BezierCurve4D NRE::Math::Matrix4x4< T >::operator* | ( | BezierCurve4D const & | c | ) | const |
Compute the bezier curve resulting in the transformation of c by this
c | the bezier curve to transform |
constexpr Matrix4x4& NRE::Math::Matrix4x4< T >::operator*= | ( | K | k | ) |
Multiply this by k
k | the multiplication factor |
constexpr Matrix4x4& NRE::Math::Matrix4x4< T >::operator*= | ( | Matrix4x4< K > const & | m | ) |
Multiply this with m
m | the matrix to multiply with this |
constexpr Matrix4x4<std::common_type_t<T, K> > NRE::Math::Matrix4x4< T >::operator+ | ( | Matrix4x4< K > const & | m | ) | const |
Compute the matrix resulting in the addition of this and m
m | the matrix to add with this |
constexpr Matrix4x4& NRE::Math::Matrix4x4< T >::operator+= | ( | Matrix4x4< K > const & | m | ) |
Add m into this
m | the matrix to add into this |
constexpr Matrix4x4<std::common_type_t<T, K> > NRE::Math::Matrix4x4< T >::operator- | ( | Matrix4x4< K > const & | m | ) | const |
Compute the matrix resulting in the subtraction of this and m
m | the matrix to subtract with this |
constexpr Matrix4x4& NRE::Math::Matrix4x4< T >::operator-= | ( | Matrix4x4< K > const & | m | ) |
Subtract m into this
m | the matrix to subtract into this |
constexpr Matrix4x4<std::common_type_t<T, K> > NRE::Math::Matrix4x4< T >::operator/ | ( | K | k | ) | const |
Compute the matrix resulting in the division of this by k
k | the division factor |
constexpr Matrix4x4<std::common_type_t<T, K> > NRE::Math::Matrix4x4< T >::operator/ | ( | Matrix4x4< K > const & | m | ) | const |
Compute the matrix resulting in the division of this and m
m | the matrix to divide with this |
constexpr Matrix4x4& NRE::Math::Matrix4x4< T >::operator/= | ( | K | k | ) |
Divide this by k
k | the division factor |
constexpr Matrix4x4& NRE::Math::Matrix4x4< T >::operator/= | ( | Matrix4x4< K > const & | m | ) |
Divide this with m
m | the matrix to divide with this |
|
default |
Copy m into this
m | the object to copy into this |
|
default |
Move m into this
m | the object to move into this |
constexpr Matrix4x4& NRE::Math::Matrix4x4< T >::operator= | ( | Matrix4x4< K > const & | m | ) |
Copy m into this
m | the object to copy into this |
constexpr Matrix4x4& NRE::Math::Matrix4x4< T >::operator= | ( | Matrix4x4< K > && | m | ) |
Move m into this
m | the object to move into this |
constexpr bool NRE::Math::Matrix4x4< T >::operator== | ( | Matrix4x4< K > const & | m | ) | const |
Equality test between this and m
m | the matrix to test with this |
constexpr Vector4D<T>& NRE::Math::Matrix4x4< T >::operator[] | ( | std::size_t | index | ) |
Return a reference on a matrix's line
index | the line's index |
constexpr Vector4D<T> const& NRE::Math::Matrix4x4< T >::operator[] | ( | std::size_t | index | ) | const |
Return a const reference on a matrix's line
index | the line's index |
constexpr Matrix4x4& NRE::Math::Matrix4x4< T >::ortho | ( | Vector2D< K > const & | h, |
Vector2D< L > const & | v, | ||
Vector2D< N > const & | z | ||
) |
Perform an orthogonal projection on this
h | the horizontal clipping plane |
v | the vertical clipping plane |
z | the projection's plane distance |
constexpr Matrix4x4& NRE::Math::Matrix4x4< T >::ortho2D | ( | Vector2D< K > const & | h, |
Vector2D< L > const & | v | ||
) |
Perform a 2D orthogonal projection on this
h | the horizontal clipping plane |
v | the vertical clipping plane |
|
inline |
Perform a perspective projection on this
fov | the projection's fov |
ratio | the projection's ratio |
z | the projection's plane distance |
constexpr Matrix4x4& NRE::Math::Matrix4x4< T >::rotate | ( | Angle | angle, |
Vector3D< K > const & | axis | ||
) |
Add a rotation
angle | the rotation's angle |
axis | the rotation's axis |
constexpr Matrix4x4& NRE::Math::Matrix4x4< T >::scale | ( | Vector3D< K > const & | u | ) |
Add a scale
u | the scaling vector |
constexpr void NRE::Math::Matrix4x4< T >::setC1 | ( | Vector4D< K > const & | c1 | ) |
First column setter
c1 | the new first column vector |
constexpr void NRE::Math::Matrix4x4< T >::setC2 | ( | Vector4D< K > const & | c2 | ) |
Second column setter
c2 | the new second column vector |
constexpr void NRE::Math::Matrix4x4< T >::setC3 | ( | Vector4D< K > const & | c3 | ) |
Third column setter
c3 | the new third column vector |
constexpr void NRE::Math::Matrix4x4< T >::setC4 | ( | Vector4D< K > const & | c4 | ) |
Fourth column setter
c4 | the new fourth column vector |
constexpr Matrix4x4& NRE::Math::Matrix4x4< T >::setIdentity | ( | ) |
Set the matrix to the identity matrix
constexpr void NRE::Math::Matrix4x4< T >::setL1 | ( | Vector4D< K > const & | l1 | ) |
First line setter
l1 | the new first line vector |
constexpr void NRE::Math::Matrix4x4< T >::setL2 | ( | Vector4D< K > const & | l2 | ) |
Second line setter
l2 | the new second line vector |
constexpr void NRE::Math::Matrix4x4< T >::setL3 | ( | Vector4D< K > const & | l3 | ) |
Third line setter
l3 | the new third line vector |
constexpr void NRE::Math::Matrix4x4< T >::setL4 | ( | Vector4D< K > const & | l4 | ) |
Fourth line setter
l4 | the new fourth line vector |
|
inline |
Add a stretch on the X axis
u | the stretch factor |
|
inline |
Add a stretch on the Y axis
u | the stretch factor |
|
inline |
Add a stretch on the Z axis
u | the stretch factor |
Utility::String NRE::Math::Matrix4x4< T >::toString | ( | ) | const |
Convert the 4x4 matrix into a string
constexpr Matrix4x4& NRE::Math::Matrix4x4< T >::translate | ( | Vector3D< K > const & | u | ) |
Add a translation
u | the translation vector |
constexpr Matrix4x4& NRE::Math::Matrix4x4< T >::transpose | ( | ) |
Transpose the matrix
constexpr const T* NRE::Math::Matrix4x4< T >::value | ( | ) | const |
|
static |
Identity matrix