struct
TMatrix3
template<typename T>A 3x3 matrix.
Can be used for non-homogenous transformations of three dimensional vectors and points. In row major format.
Public
Constructors
TMatrix3<T>
TMatrix3<T>
TMatrix3<T>
TMatrix3<T>
Construct a matrix from a TQuaternion <T >.
TMatrix3<T>
Construct a matrix that performs rotation and scale.
TMatrix3<T>
Construct a matrix from an angle/axis pair.
TMatrix3<T>
Construct a matrix from 3 orthonormal local axes.
TMatrix3<T>
Construct a matrix from euler angles, YXZ ordering.
TMatrix3<T>
Construct a matrix from euler angles, custom ordering.
Methods
GetColumn
SetColumn
Multiply
Transforms the given vector by this matrix and returns the newly transformed vector.
Transpose
Returns a transpose of the matrix (switched columns and rows).
Inverse
Calculates an inverse of the matrix if it exists.
- mat
- Resulting matrix inverse.
- fTolerance
- (optional) Tolerance to use when checking if determinant is zero (or near zero in this case). Zero determinant means inverse doesn't exist.
Returns: True if inverse exists, false otherwise.
Inverse
Calculates an inverse of the matrix if it exists.
- fTolerance
- (optional) Tolerance to use when checking if determinant is zero (or near zero in this case). Zero determinant means inverse doesn't exist.
Returns: Resulting matrix inverse if it exists, otherwise a zero matrix.
Determinant
Calculates the matrix determinant.
Decomposition
Decompose a TMatrix3 to rotation and scale.
SingularValueDecomposition
Decomposes the matrix into various useful values.
- matL
- Unitary matrix. Columns form orthonormal bases. If your matrix is affine and doesn't use non-uniform scaling this matrix will be a conjugate transpose of the rotation part of the matrix.
- matS
- Singular values of the matrix. If your matrix is affine these will be scaling factors of the matrix.
- matR
- Unitary matrix. Columns form orthonormal bases. If your matrix is affine and doesn't use non-uniform scaling this matrix will be the rotation part of the matrix.
QDUDecomposition
Decomposes the matrix into a set of values.
- matQ
- Columns form orthonormal bases. If your matrix is affine and doesn't use non-uniform scaling this matrix will be the rotation part of the matrix.
- vecD
- If the matrix is affine these will be scaling factors of the matrix.
- vecU
- If the matrix is affine these will be shear factors of the matrix.
Orthonormalize
Gram-Schmidt orthonormalization (applied to columns of rotation matrix)
ToAxisAngle
Converts an orthonormal matrix to axis angle representation.
FromAxisAngle
Creates a rotation matrix from an axis angle representation.
ToQuaternion
Converts an orthonormal matrix to TQuaternion <T > representation.
FromQuaternion
Creates a rotation matrix from a TQuaternion <T > representation.
FromAxes
Creates a matrix from a three axes.
ToEulerAngles
Converts an orthonormal matrix to euler angle (pitch/yaw/roll) representation.
- xAngle
- Rotation about x axis. (AKA Pitch)
- yAngle
- Rotation about y axis. (AKA Yaw)
- zAngle
- Rotation about z axis. (AKA Roll)
Returns: True if unique solution was found, false otherwise.
FromEulerAngles
Creates a rotation matrix from the provided Pitch/Yaw/Roll angles.
- xAngle
- Rotation about x axis. (AKA Pitch)
- yAngle
- Rotation about y axis. (AKA Yaw)
- zAngle
- Rotation about z axis. (AKA Roll)
FromEulerAngles
Creates a rotation matrix from the provided Pitch/Yaw/Roll angles.
- xAngle
- Rotation about x axis. (AKA Pitch)
- yAngle
- Rotation about y axis. (AKA Yaw)
- zAngle
- Rotation about z axis. (AKA Roll)
- order
- The order in which rotations will be applied. Different rotations can be created depending on the order.
EigenSolveSymmetric
Eigensolver, matrix must be symmetric.