Jolt Physics
A multi core friendly Game Physics Engine
|
Holds a 4x4 matrix of floats with the last column consisting of doubles. More...
#include <DMat44.h>
Public Types | |
using | Type = Vec4::Type |
using | DType = DVec3::Type |
using | DTypeArg = DVec3::TypeArg |
using | ArgType = DMat44Arg |
Public Member Functions | |
DMat44 ()=default | |
Constructor. | |
JPH_INLINE | DMat44 (Vec4Arg inC1, Vec4Arg inC2, Vec4Arg inC3, DVec3Arg inC4) |
DMat44 (const DMat44 &inM2)=default | |
JPH_INLINE | DMat44 (Mat44Arg inM) |
JPH_INLINE | DMat44 (Mat44Arg inRot, DVec3Arg inT) |
JPH_INLINE | DMat44 (Type inC1, Type inC2, Type inC3, DTypeArg inC4) |
JPH_INLINE Mat44 | ToMat44 () const |
Convert to Mat44 rounding to nearest. | |
JPH_INLINE bool | operator== (DMat44Arg inM2) const |
Comparsion. | |
JPH_INLINE bool | operator!= (DMat44Arg inM2) const |
JPH_INLINE bool | IsClose (DMat44Arg inM2, float inMaxDistSq=1.0e-12f) const |
Test if two matrices are close. | |
JPH_INLINE DMat44 | operator* (Mat44Arg inM) const |
Multiply matrix by matrix. | |
JPH_INLINE DMat44 | operator* (DMat44Arg inM) const |
Multiply matrix by matrix. | |
JPH_INLINE DVec3 | operator* (Vec3Arg inV) const |
Multiply vector by matrix. | |
JPH_INLINE DVec3 | operator* (DVec3Arg inV) const |
Multiply vector by matrix. | |
JPH_INLINE Vec3 | Multiply3x3 (Vec3Arg inV) const |
Multiply vector by only 3x3 part of the matrix. | |
JPH_INLINE DVec3 | Multiply3x3 (DVec3Arg inV) const |
Multiply vector by only 3x3 part of the matrix. | |
JPH_INLINE Vec3 | Multiply3x3Transposed (Vec3Arg inV) const |
Multiply vector by only 3x3 part of the transpose of the matrix ( \(result = this^T \: inV\)) | |
JPH_INLINE DMat44 | PreScaled (Vec3Arg inScale) const |
Scale a matrix: result = this * Mat44::sScale(inScale) | |
JPH_INLINE DMat44 | PostScaled (Vec3Arg inScale) const |
Scale a matrix: result = Mat44::sScale(inScale) * this. | |
JPH_INLINE DMat44 | PreTranslated (Vec3Arg inTranslation) const |
Pre multiply by translation matrix: result = this * Mat44::sTranslation(inTranslation) | |
JPH_INLINE DMat44 | PreTranslated (DVec3Arg inTranslation) const |
Pre multiply by translation matrix: result = this * Mat44::sTranslation(inTranslation) | |
JPH_INLINE DMat44 | PostTranslated (Vec3Arg inTranslation) const |
Post multiply by translation matrix: result = Mat44::sTranslation(inTranslation) * this (i.e. add inTranslation to the 4-th column) | |
JPH_INLINE DMat44 | PostTranslated (DVec3Arg inTranslation) const |
Post multiply by translation matrix: result = Mat44::sTranslation(inTranslation) * this (i.e. add inTranslation to the 4-th column) | |
JPH_INLINE Vec3 | GetAxisX () const |
Access to the columns. | |
JPH_INLINE void | SetAxisX (Vec3Arg inV) |
JPH_INLINE Vec3 | GetAxisY () const |
JPH_INLINE void | SetAxisY (Vec3Arg inV) |
JPH_INLINE Vec3 | GetAxisZ () const |
JPH_INLINE void | SetAxisZ (Vec3Arg inV) |
JPH_INLINE DVec3 | GetTranslation () const |
JPH_INLINE void | SetTranslation (DVec3Arg inV) |
JPH_INLINE Vec3 | GetColumn3 (uint inCol) const |
JPH_INLINE void | SetColumn3 (uint inCol, Vec3Arg inV) |
JPH_INLINE Vec4 | GetColumn4 (uint inCol) const |
JPH_INLINE void | SetColumn4 (uint inCol, Vec4Arg inV) |
JPH_INLINE DMat44 | Inversed () const |
Inverse 4x4 matrix. | |
JPH_INLINE DMat44 | InversedRotationTranslation () const |
Inverse 4x4 matrix when it only contains rotation and translation. | |
JPH_INLINE Mat44 | GetRotation () const |
Get rotation part only (note: retains the first 3 values from the bottom row) | |
JPH_INLINE void | SetRotation (Mat44Arg inRotation) |
Updates the rotation part of this matrix (the first 3 columns) | |
JPH_INLINE Quat | GetQuaternion () const |
Convert to quaternion. | |
JPH_INLINE Mat44 | GetDirectionPreservingMatrix () const |
Get matrix that transforms a direction with the same transform as this matrix (length is not preserved) | |
JPH_INLINE DMat44 | Decompose (Vec3 &outScale) const |
Works identical to Mat44::Decompose. | |
Static Public Member Functions | |
static JPH_INLINE DMat44 | sZero () |
Zero matrix. | |
static JPH_INLINE DMat44 | sIdentity () |
Identity matrix. | |
static JPH_INLINE DMat44 | sRotation (QuatArg inQuat) |
Rotate from quaternion. | |
static JPH_INLINE DMat44 | sTranslation (DVec3Arg inV) |
Get matrix that translates. | |
static JPH_INLINE DMat44 | sRotationTranslation (QuatArg inR, DVec3Arg inT) |
Get matrix that rotates and translates. | |
static JPH_INLINE DMat44 | sInverseRotationTranslation (QuatArg inR, DVec3Arg inT) |
Get inverse matrix of sRotationTranslation. | |
static JPH_INLINE DMat44 | sScale (Vec3Arg inV) |
Get matrix that scales (produces a matrix with (inV, 1) on its diagonal) | |
Friends | |
ostream & | operator<< (ostream &inStream, DMat44Arg inM) |
To String. | |
Holds a 4x4 matrix of floats with the last column consisting of doubles.
using DMat44::ArgType = DMat44Arg |
using DMat44::DType = DVec3::Type |
using DMat44::DTypeArg = DVec3::TypeArg |
using DMat44::Type = Vec4::Type |
|
default |
Constructor.
Intentionally not initialized for performance reasons
JPH_NAMESPACE_BEGIN DMat44::DMat44 | ( | Vec4Arg | inC1, |
Vec4Arg | inC2, | ||
Vec4Arg | inC3, | ||
DVec3Arg | inC4 ) |
|
default |
|
explicit |
Works identical to Mat44::Decompose.
|
inline |
Access to the columns.
|
inline |
|
inline |
|
inline |
Get matrix that transforms a direction with the same transform as this matrix (length is not preserved)
|
inline |
Convert to quaternion.
|
inline |
Get rotation part only (note: retains the first 3 values from the bottom row)
|
inline |
DMat44 DMat44::Inversed | ( | ) | const |
Inverse 4x4 matrix.
DMat44 DMat44::InversedRotationTranslation | ( | ) | const |
Inverse 4x4 matrix when it only contains rotation and translation.
bool DMat44::IsClose | ( | DMat44Arg | inM2, |
float | inMaxDistSq = 1.0e-12f ) const |
Test if two matrices are close.
Multiply vector by only 3x3 part of the matrix.
Multiply vector by only 3x3 part of the transpose of the matrix ( \(result = this^T \: inV\))
|
inline |
bool DMat44::operator== | ( | DMat44Arg | inM2 | ) | const |
Comparsion.
Scale a matrix: result = Mat44::sScale(inScale) * this.
Post multiply by translation matrix: result = Mat44::sTranslation(inTranslation) * this (i.e. add inTranslation to the 4-th column)
Post multiply by translation matrix: result = Mat44::sTranslation(inTranslation) * this (i.e. add inTranslation to the 4-th column)
Scale a matrix: result = this * Mat44::sScale(inScale)
Pre multiply by translation matrix: result = this * Mat44::sTranslation(inTranslation)
Pre multiply by translation matrix: result = this * Mat44::sTranslation(inTranslation)
|
inline |
|
inline |
|
inline |
void DMat44::SetRotation | ( | Mat44Arg | inRotation | ) |
Updates the rotation part of this matrix (the first 3 columns)
|
inline |
|
static |
Identity matrix.
Get inverse matrix of sRotationTranslation.
Get matrix that rotates and translates.
Get matrix that scales (produces a matrix with (inV, 1) on its diagonal)
Get matrix that translates.
|
static |
Zero matrix.
|
friend |
To String.