Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
DMat44 Class Reference

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. More...
 
JPH_INLINE DMat44 (Vec4Arg inC1, Vec4Arg inC2, Vec4Arg inC3, DVec3Arg inC4)
 
 DMat44 (const DMat44 &inM2)=default
 
DMat44operator= (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. More...
 
JPH_INLINE bool operator== (DMat44Arg inM2) const
 Comparison. More...
 
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. More...
 
JPH_INLINE DMat44 operator* (Mat44Arg inM) const
 Multiply matrix by matrix. More...
 
JPH_INLINE DMat44 operator* (DMat44Arg inM) const
 Multiply matrix by matrix. More...
 
JPH_INLINE DVec3 operator* (Vec3Arg inV) const
 Multiply vector by matrix. More...
 
JPH_INLINE DVec3 operator* (DVec3Arg inV) const
 Multiply vector by matrix. More...
 
JPH_INLINE Vec3 Multiply3x3 (Vec3Arg inV) const
 Multiply vector by only 3x3 part of the matrix. More...
 
JPH_INLINE DVec3 Multiply3x3 (DVec3Arg inV) const
 Multiply vector by only 3x3 part of the matrix. More...
 
JPH_INLINE Vec3 Multiply3x3Transposed (Vec3Arg inV) const
 Multiply vector by only 3x3 part of the transpose of the matrix ( \(result = this^T \: inV\)) More...
 
JPH_INLINE DMat44 PreScaled (Vec3Arg inScale) const
 Scale a matrix: result = this * Mat44::sScale(inScale) More...
 
JPH_INLINE DMat44 PostScaled (Vec3Arg inScale) const
 Scale a matrix: result = Mat44::sScale(inScale) * this. More...
 
JPH_INLINE DMat44 PreTranslated (Vec3Arg inTranslation) const
 Pre multiply by translation matrix: result = this * Mat44::sTranslation(inTranslation) More...
 
JPH_INLINE DMat44 PreTranslated (DVec3Arg inTranslation) const
 Pre multiply by translation matrix: result = this * Mat44::sTranslation(inTranslation) More...
 
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) More...
 
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) More...
 
JPH_INLINE Vec3 GetAxisX () const
 Access to the columns. More...
 
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 Mat44 Transposed3x3 () const
 Transpose 3x3 subpart of matrix. More...
 
JPH_INLINE DMat44 Inversed () const
 Inverse 4x4 matrix. More...
 
JPH_INLINE DMat44 InversedRotationTranslation () const
 Inverse 4x4 matrix when it only contains rotation and translation. More...
 
JPH_INLINE Mat44 GetRotation () const
 Get rotation part only (note: retains the first 3 values from the bottom row) More...
 
JPH_INLINE void SetRotation (Mat44Arg inRotation)
 Updates the rotation part of this matrix (the first 3 columns) More...
 
JPH_INLINE Quat GetQuaternion () const
 Convert to quaternion. More...
 
JPH_INLINE Mat44 GetDirectionPreservingMatrix () const
 Get matrix that transforms a direction with the same transform as this matrix (length is not preserved) More...
 
JPH_INLINE DMat44 Decompose (Vec3 &outScale) const
 Works identical to Mat44::Decompose. More...
 

Static Public Member Functions

static JPH_INLINE DMat44 sZero ()
 Zero matrix. More...
 
static JPH_INLINE DMat44 sIdentity ()
 Identity matrix. More...
 
static JPH_INLINE DMat44 sRotation (QuatArg inQuat)
 Rotate from quaternion. More...
 
static JPH_INLINE DMat44 sTranslation (DVec3Arg inV)
 Get matrix that translates. More...
 
static JPH_INLINE DMat44 sRotationTranslation (QuatArg inR, DVec3Arg inT)
 Get matrix that rotates and translates. More...
 
static JPH_INLINE DMat44 sInverseRotationTranslation (QuatArg inR, DVec3Arg inT)
 Get inverse matrix of sRotationTranslation. More...
 
static JPH_INLINE DMat44 sScale (Vec3Arg inV)
 Get matrix that scales (produces a matrix with (inV, 1) on its diagonal) More...
 

Friends

ostream & operator<< (ostream &inStream, DMat44Arg inM)
 To String. More...
 

Detailed Description

Holds a 4x4 matrix of floats with the last column consisting of doubles.

Member Typedef Documentation

◆ ArgType

◆ DType

◆ DTypeArg

◆ Type

Constructor & Destructor Documentation

◆ DMat44() [1/6]

DMat44::DMat44 ( )
default

Constructor.

Intentionally not initialized for performance reasons

◆ DMat44() [2/6]

JPH_NAMESPACE_BEGIN DMat44::DMat44 ( Vec4Arg  inC1,
Vec4Arg  inC2,
Vec4Arg  inC3,
DVec3Arg  inC4 
)

◆ DMat44() [3/6]

DMat44::DMat44 ( const DMat44 inM2)
default

◆ DMat44() [4/6]

DMat44::DMat44 ( Mat44Arg  inM)
explicit

◆ DMat44() [5/6]

DMat44::DMat44 ( Mat44Arg  inRot,
DVec3Arg  inT 
)

◆ DMat44() [6/6]

DMat44::DMat44 ( Type  inC1,
Type  inC2,
Type  inC3,
DTypeArg  inC4 
)

Member Function Documentation

◆ Decompose()

JPH_INLINE DMat44 DMat44::Decompose ( Vec3 outScale) const
inline

Works identical to Mat44::Decompose.

◆ GetAxisX()

JPH_INLINE Vec3 DMat44::GetAxisX ( ) const
inline

Access to the columns.

◆ GetAxisY()

JPH_INLINE Vec3 DMat44::GetAxisY ( ) const
inline

◆ GetAxisZ()

JPH_INLINE Vec3 DMat44::GetAxisZ ( ) const
inline

◆ GetColumn3()

JPH_INLINE Vec3 DMat44::GetColumn3 ( uint  inCol) const
inline

◆ GetColumn4()

JPH_INLINE Vec4 DMat44::GetColumn4 ( uint  inCol) const
inline

◆ GetDirectionPreservingMatrix()

JPH_INLINE Mat44 DMat44::GetDirectionPreservingMatrix ( ) const
inline

Get matrix that transforms a direction with the same transform as this matrix (length is not preserved)

◆ GetQuaternion()

JPH_INLINE Quat DMat44::GetQuaternion ( ) const
inline

Convert to quaternion.

◆ GetRotation()

JPH_INLINE Mat44 DMat44::GetRotation ( ) const
inline

Get rotation part only (note: retains the first 3 values from the bottom row)

◆ GetTranslation()

JPH_INLINE DVec3 DMat44::GetTranslation ( ) const
inline

◆ Inversed()

DMat44 DMat44::Inversed ( ) const

Inverse 4x4 matrix.

◆ InversedRotationTranslation()

DMat44 DMat44::InversedRotationTranslation ( ) const

Inverse 4x4 matrix when it only contains rotation and translation.

◆ IsClose()

bool DMat44::IsClose ( DMat44Arg  inM2,
float  inMaxDistSq = 1.0e-12f 
) const

Test if two matrices are close.

◆ Multiply3x3() [1/2]

DVec3 DMat44::Multiply3x3 ( DVec3Arg  inV) const

Multiply vector by only 3x3 part of the matrix.

◆ Multiply3x3() [2/2]

JPH_INLINE Vec3 DMat44::Multiply3x3 ( Vec3Arg  inV) const
inline

Multiply vector by only 3x3 part of the matrix.

◆ Multiply3x3Transposed()

JPH_INLINE Vec3 DMat44::Multiply3x3Transposed ( Vec3Arg  inV) const
inline

Multiply vector by only 3x3 part of the transpose of the matrix ( \(result = this^T \: inV\))

◆ operator!=()

JPH_INLINE bool DMat44::operator!= ( DMat44Arg  inM2) const
inline

◆ operator*() [1/4]

DMat44 DMat44::operator* ( DMat44Arg  inM) const

Multiply matrix by matrix.

◆ operator*() [2/4]

DVec3 DMat44::operator* ( DVec3Arg  inV) const

Multiply vector by matrix.

◆ operator*() [3/4]

DMat44 DMat44::operator* ( Mat44Arg  inM) const

Multiply matrix by matrix.

◆ operator*() [4/4]

DVec3 DMat44::operator* ( Vec3Arg  inV) const

Multiply vector by matrix.

◆ operator=()

DMat44 & DMat44::operator= ( const DMat44 inM2)
default

◆ operator==()

bool DMat44::operator== ( DMat44Arg  inM2) const

Comparison.

◆ PostScaled()

DMat44 DMat44::PostScaled ( Vec3Arg  inScale) const

Scale a matrix: result = Mat44::sScale(inScale) * this.

◆ PostTranslated() [1/2]

DMat44 DMat44::PostTranslated ( DVec3Arg  inTranslation) const

Post multiply by translation matrix: result = Mat44::sTranslation(inTranslation) * this (i.e. add inTranslation to the 4-th column)

◆ PostTranslated() [2/2]

DMat44 DMat44::PostTranslated ( Vec3Arg  inTranslation) const

Post multiply by translation matrix: result = Mat44::sTranslation(inTranslation) * this (i.e. add inTranslation to the 4-th column)

◆ PreScaled()

DMat44 DMat44::PreScaled ( Vec3Arg  inScale) const

Scale a matrix: result = this * Mat44::sScale(inScale)

◆ PreTranslated() [1/2]

DMat44 DMat44::PreTranslated ( DVec3Arg  inTranslation) const

Pre multiply by translation matrix: result = this * Mat44::sTranslation(inTranslation)

◆ PreTranslated() [2/2]

DMat44 DMat44::PreTranslated ( Vec3Arg  inTranslation) const

Pre multiply by translation matrix: result = this * Mat44::sTranslation(inTranslation)

◆ SetAxisX()

JPH_INLINE void DMat44::SetAxisX ( Vec3Arg  inV)
inline

◆ SetAxisY()

JPH_INLINE void DMat44::SetAxisY ( Vec3Arg  inV)
inline

◆ SetAxisZ()

JPH_INLINE void DMat44::SetAxisZ ( Vec3Arg  inV)
inline

◆ SetColumn3()

JPH_INLINE void DMat44::SetColumn3 ( uint  inCol,
Vec3Arg  inV 
)
inline

◆ SetColumn4()

JPH_INLINE void DMat44::SetColumn4 ( uint  inCol,
Vec4Arg  inV 
)
inline

◆ SetRotation()

void DMat44::SetRotation ( Mat44Arg  inRotation)

Updates the rotation part of this matrix (the first 3 columns)

◆ SetTranslation()

JPH_INLINE void DMat44::SetTranslation ( DVec3Arg  inV)
inline

◆ sIdentity()

DMat44 DMat44::sIdentity ( )
static

Identity matrix.

◆ sInverseRotationTranslation()

DMat44 DMat44::sInverseRotationTranslation ( QuatArg  inR,
DVec3Arg  inT 
)
static

Get inverse matrix of sRotationTranslation.

◆ sRotation()

static JPH_INLINE DMat44 DMat44::sRotation ( QuatArg  inQuat)
inlinestatic

Rotate from quaternion.

◆ sRotationTranslation()

static JPH_INLINE DMat44 DMat44::sRotationTranslation ( QuatArg  inR,
DVec3Arg  inT 
)
inlinestatic

Get matrix that rotates and translates.

◆ sScale()

static JPH_INLINE DMat44 DMat44::sScale ( Vec3Arg  inV)
inlinestatic

Get matrix that scales (produces a matrix with (inV, 1) on its diagonal)

◆ sTranslation()

static JPH_INLINE DMat44 DMat44::sTranslation ( DVec3Arg  inV)
inlinestatic

Get matrix that translates.

◆ sZero()

DMat44 DMat44::sZero ( )
static

Zero matrix.

◆ ToMat44()

JPH_INLINE Mat44 DMat44::ToMat44 ( ) const
inline

Convert to Mat44 rounding to nearest.

◆ Transposed3x3()

JPH_INLINE Mat44 DMat44::Transposed3x3 ( ) const
inline

Transpose 3x3 subpart of matrix.

Friends And Related Function Documentation

◆ operator<<

ostream & operator<< ( ostream &  inStream,
DMat44Arg  inM 
)
friend

To String.


The documentation for this class was generated from the following files: