Matrix34_tpl

#include

Inherits INumberArray< F, 12 >.

Public Types

typedef INumberArray< F, 12 > NA

Public Member Functions

ILINE Matrix34_tpl (type_zero)
template
ILINE Matrix34_tpl (const Matrix34_tpl< F1 > &m)
template
ILINE Matrix34_tpl (const Matrix34H< F1 > &m)
ILINE Matrix34_tpl (type_identity)
Set matrix to Identity.
ILINE Matrix34_tpl (F v00, F v01, F v02, F v03, F v10, F v11, F v12, F v13, F v20, F v21, F v22, F v23)
CONSTRUCTOR for identical float-types. It initialises a matrix34 with 12 floats.
template
ILINE Matrix34_tpl (const Matrix33_tpl< F1 > &m)
template
ILINE Matrix34_tpl (const Matrix33_tpl< F1 > &m, const Vec3_tpl< F1 > &t)
template
ILINE Matrix34_tpl (type_identity, const Vec3_tpl< F1 > &t)
template
ILINE Matrix34_tpl (const Matrix44_tpl< F1 > &m)
template
ILINE Matrix34_tpl (const Quat_tpl< F1 > &q)
template
ILINE Matrix34_tpl (const QuatT_tpl< F1 > q)
template
ILINE Matrix34_tpl (const QuatTS_tpl< F1 > &q)
template
ILINE Matrix34_tpl (const QuatTNS_tpl< F1 > &q)
template
ILINE Matrix34_tpl (const DualQuat_tpl< F1 > &q)
ILINE void ScaleColumn (const Vec3_tpl< F > &s)
Applies scaling to the coordinate frame's axes.
ILINE void ScaleColumn (const float &s)
Applies scaling to the coordinate frame's axes.
void SetIdentity (void)
Initializes the Matrix34 with the identity.
ILINE bool IsIdentity () const
ILINE void SetRotationAA (const F rad, const Vec3_tpl< F > &axis, const Vec3_tpl< F > &t=Vec3(ZERO))
ILINE void SetRotationAA (const Vec3_tpl< F > &rot, const Vec3_tpl< F > &t=Vec3(ZERO))
ILINE void SetRotationX (const F rad, const Vec3_tpl< F > &t=Vec3(ZERO))
ILINE void SetRotationY (const F rad, const Vec3_tpl< F > &t=Vec3(ZERO))
ILINE void SetRotationZ (const F rad, const Vec3_tpl< F > &t=Vec3(ZERO))
ILINE void SetRotationXYZ (const Ang3_tpl< F > &rad, const Vec3_tpl< F > &t=Vec3(ZERO))
ILINE void SetRotationAA (F c, F s, Vec3_tpl< F > axis, const Vec3_tpl< F > &t=Vec3(ZERO))
ILINE void SetTranslationMat (const Vec3_tpl< F > &v)
ILINE void SetFromVectors (const Vec3 &vx, const Vec3 &vy, const Vec3 &vz, const Vec3 &pos)
void InvertFast ()
In-place inversion.
Matrix34_tpl< F > GetInvertedFast () const
ILINE Vec3_tpl< F > TransformVector (const Vec3_tpl< F > &v) const
transforms a vector. the translation is not beeing considered
ILINE Vec3_tpl< F > TransformPoint (const Vec3_tpl< F > &p) const
transforms a point and add translation vector
void OrthonormalizeFast ()
Remove scale from matrix.
ILINE F Determinant () const
Determinant assumes a 4th row = (0,0,0,1); therefore only the upper-left-submatrix's determinant is calculated.
ILINE F GetUniformScale () const
ILINE Vec3 GetScale () const
F * GetData ()
const F * GetData () const
ILINE F operator() (uint32 i, uint32 j) const
ILINE F & operator() (uint32 i, uint32 j)
ILINE void SetRow (int i, const Vec3_tpl< F > &v)
ILINE void SetRow4 (int i, const Vec4_tpl< F > &v)
ILINE const Vec3_tpl< F > & GetRow (int i) const
ILINE const Vec4_tpl< F > & GetRow4 (int i) const
ILINE void SetColumn (int i, const Vec3_tpl< F > &v)
ILINE Vec3_tpl< F > GetColumn (int i) const
ILINE Vec3_tpl< F > GetColumn0 () const
ILINE Vec3_tpl< F > GetColumn1 () const
ILINE Vec3_tpl< F > GetColumn2 () const
ILINE Vec3_tpl< F > GetColumn3 () const
ILINE void SetTranslation (const Vec3_tpl< F > &t)
ILINE Vec3_tpl< F > GetTranslation () const
ILINE void ScaleTranslation (F s)
ILINE Matrix34_tpl< F > AddTranslation (const Vec3_tpl< F > &t)
ILINE void SetRotation33 (const Matrix33_tpl< F > &m33)
ILINE void GetRotation33 (Matrix33_tpl< F > &m33) const
int IsOrthonormal (F threshold=0.001) const
Check if we have an orthonormal-base (general case, works even with reflection matrices).
int IsOrthonormalRH (F threshold=0.001) const
Check if we have an orthonormal-base (assuming we are using a right-handed coordinate system).
ILINE void Set (const Vec3_tpl< F > &s, const Quat_tpl< F > &q, const Vec3_tpl< F > &t=Vec3(ZERO))
Matrix34_tpl (const Vec3_tpl< F > &s, const Quat_tpl< F > &q, const Vec3_tpl< F > &t=Vec3(ZERO))
ILINE void SetScale (const Vec3_tpl< F > &s, const Vec3_tpl< F > &t=Vec3(ZERO))
ILINE Matrix44_tpl< F > GetTransposed () const
ILINE Matrix34_tpl< F > & Transpose (const Matrix34_tpl< F > &m)
void Invert (const Matrix34_tpl< F > &m)
ILINE void Invert ()
ILINE Matrix34_tpl< F > GetInverted () const
void Magnitude (const Matrix34_tpl< F > &m)
ILINE void Magnitude ()
ILINE Matrix34_tpl< F > GetMagnitude () const

Static Public Member Functions

static ILINE Matrix34_tpl< F > CreateIdentity (void)
static ILINE Matrix34_tpl< F > CreateRotationAA (const F rad, const Vec3_tpl< F > &axis, const Vec3_tpl< F > &t=Vec3(ZERO))
static ILINE Matrix34_tpl< F > CreateRotationAA (const Vec3_tpl< F > &rot, const Vec3_tpl< F > &t=Vec3(ZERO))
static ILINE Matrix34_tpl< F > CreateRotationX (const F rad, const Vec3_tpl< F > &t=Vec3(ZERO))
static ILINE Matrix34_tpl< F > CreateRotationY (const F rad, const Vec3_tpl< F > &t=Vec3(ZERO))
static ILINE Matrix34_tpl< F > CreateRotationZ (const F rad, const Vec3_tpl< F > &t=Vec3(ZERO))
static ILINE Matrix34_tpl< F > CreateRotationXYZ (const Ang3_tpl< F > &rad, const Vec3_tpl< F > &t=Vec3(ZERO))
static ILINE Matrix34_tpl< F > CreateRotationAA (F c, F s, Vec3_tpl< F > axis, const Vec3_tpl< F > &t=Vec3(ZERO))
static ILINE Matrix34_tpl< F > CreateTranslationMat (const Vec3_tpl< F > &v)
static ILINE Matrix34_tpl< F > CreateFromVectors (const Vec3_tpl< F > &vx, const Vec3_tpl< F > &vy, const Vec3_tpl< F > &vz, const Vec3_tpl< F > &pos)
static ILINE Matrix34_tpl< F > Create (const Vec3_tpl< F > &s, const Quat_tpl< F > &q, const Vec3_tpl< F > &t=Vec3(ZERO))
static ILINE Matrix34_tpl< F > CreateScale (const Vec3_tpl< F > &s, const Vec3_tpl< F > &t=Vec3(ZERO))
static ILINE Matrix34_tpl< F > CreateReflectionMat (const Vec3_tpl< F > &p, const Vec3_tpl< F > &n)

Public Attributes

F m00
F m01
F m02
F m03
F m10
F m11
F m12
F m13
F m20
F m21
F m22
F m23
AUTO_STRUCT_INFO

Detailed Description

template struct Matrix34_tpl< F >

Represents a 3x4 matrix

See also
Matrix34

Constructor & Destructor Documentation

◆ Matrix34_tpl() [1/9]

template
template
ILINE Matrix34_tpl< F >::Matrix34_tpl ( const Matrix33_tpl< F1 > & m)
inline

CONSTRUCTOR for different float-types. It converts a Matrix33 into a Matrix34 and also converts between double/float. Matrix34(Matrix33);

◆ Matrix34_tpl() [2/9]

template
template
ILINE Matrix34_tpl< F >::Matrix34_tpl ( const Matrix33_tpl< F1 > & m,
const Vec3_tpl< F1 > & t
)
inline

CONSTRUCTOR for different float-types. It converts a Matrix33 with a translation-vector into a Matrix34 and also converts between double/float. Matrix34(Matrix33r,Vec3d(1,2,3));

◆ Matrix34_tpl() [3/9]

template
template
ILINE Matrix34_tpl< F >::Matrix34_tpl ( type_identity ,
const Vec3_tpl< F1 > & t
)
inline

CONSTRUCTOR for different float-types. It constructs a Matrix34 with translation only. Matrix34(IDENTITY, Vec3d(1,2,3));

◆ Matrix34_tpl() [4/9]

template
template
ILINE Matrix34_tpl< F >::Matrix34_tpl ( const Matrix44_tpl< F1 > & m)
inline
explicit

CONSTRUCTOR for different float types. It converts a Matrix44 into a Matrix34 and converts between double/float. Needs to be 'explicit' because we loose the translation vector in the conversion process. Matrix34(m44r);

◆ Matrix34_tpl() [5/9]

template
template
ILINE Matrix34_tpl< F >::Matrix34_tpl ( const Quat_tpl< F1 > & q)
inline
explicit

CONSTRUCTOR for different float-types. It converts a Quat into a Matrix34. Needs to be 'explicit' because we loose float-precision in the conversion process. Matrix34(QuatTd);

◆ Matrix34_tpl() [6/9]

template
template
ILINE Matrix34_tpl< F >::Matrix34_tpl ( const QuatT_tpl< F1 > q)
inline
explicit

CONSTRUCTOR for different float-types. It converts a QuatT into a Matrix34. Needs to be 'explicit' because we loose float-precision in the conversion process. Matrix34(QuatT);

◆ Matrix34_tpl() [7/9]

template
template
ILINE Matrix34_tpl< F >::Matrix34_tpl ( const QuatTS_tpl< F1 > & q)
inline
explicit

CONSTRUCTOR for different float-types. It converts a QuatTS into a Matrix34. Needs to be 'explicit' because we loose float-precision in the conversion process. Matrix34(QuatT);

◆ Matrix34_tpl() [8/9]

template
template
ILINE Matrix34_tpl< F >::Matrix34_tpl ( const QuatTNS_tpl< F1 > & q)
inline
explicit

CONSTRUCTOR for different float-types. It converts a QuatTNS into a Matrix34. Needs to be 'explicit' because we loose float-precision in the conversion process. Matrix34(QuatT);

◆ Matrix34_tpl() [9/9]

template
template
ILINE Matrix34_tpl< F >::Matrix34_tpl ( const DualQuat_tpl< F1 > & q)
inline
explicit

CONSTRUCTOR for different float-types. It converts a DualQuat into a Matrix34. Needs to be 'explicit' because we loose float-precision in the conversion process. Matrix34(QuatT);

Member Function Documentation

◆ CreateReflectionMat()

template
static ILINE Matrix34_tpl Matrix34_tpl< F >::CreateReflectionMat ( const Vec3_tpl< F > & p,
const Vec3_tpl< F > & n
)
inline
static

Reflect a rotation matrix with respect to a plane. Example: Vec3 normal( 0.0f,-1.0f, 0.0f); Vec3 pos(0,1000,0); Matrix34 m34=CreateReflectionMat( pos, normal );

◆ Invert()

template
void Matrix34_tpl< F >::Invert ( const Matrix34_tpl< F > & m)
inline

Calculate a real inversion of a Matrix34. An inverse-matrix is an UnDo-matrix for all kind of transformations. Example 1: Matrix34 im34; im34.Invert(); Example 2: Matrix34 im34 = m34.GetInverted();

◆ Set()

template
ILINE void Matrix34_tpl< F >::Set ( const Vec3_tpl< F > & s,
const Quat_tpl< F > & q,
const Vec3_tpl< F > & t = Vec3(ZERO)
)
inline

Create a matrix with SCALING, ROTATION and TRANSLATION (in this order). Example 1: Matrix m34; m34.SetMatrix( Vec3(1,2,3), quat, Vec3(11,22,33) );

◆ SetFromVectors()

template
ILINE void Matrix34_tpl< F >::SetFromVectors ( const Vec3 & vx,
const Vec3 & vy,
const Vec3 & vz,
const Vec3 & pos
)
inline
Note
All vectors are stored in columns.

◆ SetRotationAA()

template
ILINE void Matrix34_tpl< F >::SetRotationAA ( const F rad,
const Vec3_tpl< F > & axis,
const Vec3_tpl< F > & t = Vec3(ZERO)
)
inline

Create a rotation matrix around an arbitrary axis (Eulers Theorem). The axis is specified as an normalized Vec3. The angle is assumed to be in radians. This function also assumes a translation-vector and stores it in the right column. Example: Matrix34 m34; Vec3 axis=GetNormalized( Vec3(-1.0f,-0.3f,0.0f) ); m34.SetRotationAA( 3.14314f, axis, Vec3(5,5,5) );

◆ SetRotationX()

template
ILINE void Matrix34_tpl< F >::SetRotationX ( const F rad,
const Vec3_tpl< F > & t = Vec3(ZERO)
)
inline

Create rotation-matrix about X axis using an angle. The angle is assumed to be in radians. The translation-vector is set to zero. Example: Matrix34 m34; m34.SetRotationX(0.5f);

◆ SetRotationXYZ()

template
ILINE void Matrix34_tpl< F >::SetRotationXYZ ( const Ang3_tpl< F > & rad,
const Vec3_tpl< F > & t = Vec3(ZERO)
)
inline

Convert three Euler angle to mat33 (rotation order:XYZ) The Euler angles are assumed to be in radians. The translation-vector is set to zero. Example 1: Matrix34 m34; m34.SetRotationXYZ( Ang3(0.5f,0.2f,0.9f), translation ); Example 2: Matrix34 m34=Matrix34::CreateRotationXYZ( Ang3(0.5f,0.2f,0.9f), translation );

◆ SetRotationY()

template
ILINE void Matrix34_tpl< F >::SetRotationY ( const F rad,
const Vec3_tpl< F > & t = Vec3(ZERO)
)
inline

Create rotation-matrix about Y axis using an angle. The angle is assumed to be in radians. The translation-vector is set to zero.

Example: Matrix34 m34; m34.SetRotationY(0.5f);

◆ SetRotationZ()

template
ILINE void Matrix34_tpl< F >::SetRotationZ ( const F rad,
const Vec3_tpl< F > & t = Vec3(ZERO)
)
inline

Create rotation-matrix about Z axis using an angle. The angle is assumed to be in radians. The translation-vector is set to zero. Example: Matrix34 m34; m34.SetRotationZ(0.5f);

◆ SetScale()

template
ILINE void Matrix34_tpl< F >::SetScale ( const Vec3_tpl< F > & s,
const Vec3_tpl< F > & t = Vec3(ZERO)
)
inline

Create scaling-matrix. The translation-vector is set to zero. Example 1: Matrix m34; m34.SetScale( Vec3(0.5f, 1.0f, 2.0f) ); Example 2: Matrix34 m34 = Matrix34::CreateScale( Vec3(0.5f, 1.0f, 2.0f) );