#include <vector.h>
Public Types | |
| using | VectorStrideType = typename V::VectorStrideType |
| using | ValueType = typename V::ValueType |
| using | ValueTypeParam = typename ByValueParam< ValueType >::type |
| using | BoolType = typename V::BoolType |
Public Member Functions | |
| SqMat4 () | |
| SqMat4 (const V &v1_in, const V &v2_in, const V &v3_in, const V &v4_in) | |
| template<typename V2 > | |
| SqMat4 (const SqMat4< V2 > &m) | |
| template<typename V2 > | |
| SqMat4 (const Mat3< V2 > &m) | |
| SqMat4 (ENUM_DONT_INITIALIZE v) | |
| void | SetIdentity () |
| V & | operator[] (Int idx) |
| const V & | operator[] (Int idx) const |
| Mat3< Vec3< ValueType, 1 > > | GetMatrix3d () |
| template<typename V2 > | |
| SqMat4< typename MultiplicativePromotion< V, typename V2::ValueType >::type > | operator* (const SqMat4< V2 > &m2) const |
| template<typename T , Int S> | |
| Vec4< typename MultiplicativePromotion< ValueType, T >::type, 1 > | operator* (const Vec4< T, S > &v) const |
| template<typename T , Int S> | |
| Vec3< typename MultiplicativePromotion< ValueType, T >::type, 1 > | operator* (const Vec3< T, S > &v) const |
| SqMat4 | operator* (ValueTypeParam s) const |
| SqMat4 | operator/ (ValueTypeParam s) const |
| SqMat4 | operator+ (const SqMat4 &m2) const |
| SqMat4 | operator- (const SqMat4 &m2) const |
| BoolType | operator== (const SqMat4 &other) const |
| BoolType | operator!= (const SqMat4 &other) const |
| ValueType | Det () const |
| SqMat4 | operator~ () const |
| void | Normalize () |
| SqMat4 | GetNormalized () const |
| SqMat4 | GetTransposed () const |
| SqMat4 & | operator*= (const V &v) |
| SqMat4 & | operator*= (ValueTypeParam r) |
| String | ToString (const FormatStatement *formatStatement) const |
| UInt | GetHashCode () const |
Static Public Member Functions | |
| static const SqMat4 & | NullValue () |
Public Attributes | |
| V | v1 |
| V | v2 |
| V | v3 |
| V | v4 |
Static Private Member Functions | |
| static ValueType | Det3 (ValueType a1, ValueType a2, ValueType a3, ValueType b1, ValueType b2, ValueType b3, ValueType c1, ValueType c2, ValueType c3) |
Friends | |
| SqMat4 | operator* (ValueTypeParam s, const SqMat4 &m) |
| using VectorStrideType = typename V::VectorStrideType |
| using ValueType = typename V::ValueType |
| using ValueTypeParam = typename ByValueParam<ValueType>::type |
| using BoolType = typename V::BoolType |
The type returned by comparisons. If the template argument for V is a vector of SIMD components, this will be a SIMD type, too, which contains the per-element results.
| SqMat4 | ( | ) |
Default constructor, creates an identity matrix.
| SqMat4 | ( | const V & | v1_in, |
| const V & | v2_in, | ||
| const V & | v3_in, | ||
| const V & | v4_in | ||
| ) |
Initializes matrix from individual components.
|
explicit |
Skips initialization of matrix (for better speed)
| void SetIdentity | ( | ) |
Sets this matrix to an identity matrix.
| V& operator[] | ( | Int | idx | ) |
Array (subscript) operator for index access to the matrix components.
| [in] | idx | Element index (if it's out of bounds you will get an error in debug code only, otherwise it will crash). |
| const V& operator[] | ( | Int | idx | ) | const |
Array (subscript) operator for const index access to the matrix components.
| [in] | idx | Element index (if it's out of bounds you will get an error in debug code only, otherwise it will crash). |
| SqMat4<typename MultiplicativePromotion<V, typename V2::ValueType>::type> operator* | ( | const SqMat4< V2 > & | m2 | ) | const |
Multiplies two matrices. The rule is m1 AFTER m2 If you transform a vector with the result matrix this is identical to first transforming with m2 and then with m1
| Vec4<typename MultiplicativePromotion<ValueType, T>::type, 1> operator* | ( | const Vec4< T, S > & | v | ) | const |
Multiplies a 4d vector by a matrix.
| Vec3<typename MultiplicativePromotion<ValueType, T>::type, 1> operator* | ( | const Vec3< T, S > & | v | ) | const |
Transforms a 3d vector by a matrix.
| SqMat4 operator* | ( | ValueTypeParam | s | ) | const |
Scales all matrix components by a scalar value.
| SqMat4 operator/ | ( | ValueTypeParam | s | ) | const |
Divides all matrix components by a scalar value. If s is 0.0 an identity matrix will be returned.
Equality operator.
| [in] | other | Comparison matrix. |
Inequality operator.
| [in] | other | Comparison matrix. |
| ValueType Det | ( | ) | const |
Computes the determinant of this matrix.
| SqMat4 operator~ | ( | ) | const |
Calculates the inverse matrix If no inverse can be calculated the result is the Identity matrix
| void Normalize | ( | ) |
Normalizes the length of all four axes.
| SqMat4 GetNormalized | ( | ) | const |
Returns this matrix with all vectors normalized.
| SqMat4 GetTransposed | ( | ) | const |
Returns the transposed matrix.
| SqMat4& operator*= | ( | const V & | v | ) |
Scales each axis by the respective components of the passed vector.
| SqMat4& operator*= | ( | ValueTypeParam | r | ) |
Scales each axis by the scalar.
| String ToString | ( | const FormatStatement * | formatStatement | ) | const |
Returns a readable string of the content.
| [in] | formatStatement | Nullptr or additional formatting instruction. See also format_float. |
| UInt GetHashCode | ( | ) | const |
Returns the hash code of the matrix (used for hash maps and comparisons).
|
static |
Returns a null value of the matrix (see nullvalue.h for more details).
|
staticprivate |
|
friend |
Scales all matrix components by a scalar value.
| V v1 |
The X axis.
| V v2 |
The Y axis.
| V v3 |
The Z axis.
| V v4 |
The W axis.