14 template<>
void Matrix<4,4,Float>::decompose( option<Vec3&> trans, option<Quat&> rot,
15 option<Vec3&> scale, option<Quat&> skew)
const;
26 static FLOAT* DX(
Float& f) {
return reinterpret_cast<FLOAT*
>(&f); }
27 static D3DXVECTOR3* DX(
Vec3_f& v) {
return reinterpret_cast<D3DXVECTOR3*
>(&v); }
28 static D3DXQUATERNION* DX(
Quat_f& q) {
return reinterpret_cast<D3DXQUATERNION*
>(&q); }
29 static D3DXMATRIX* DX(
Matrix4_f& m) {
return reinterpret_cast<D3DXMATRIX*
>(&m); }
30 static const D3DXMATRIX* DX(
const Matrix4_f& m) {
return reinterpret_cast<const D3DXMATRIX*
>(&m); }
34 D3DXMatrixMultiply(DX(res), DX(*
this), DX(rhs));
40 Matrix trans = transpose();
41 D3DXMatrixMultiply(DX(res), DX(trans), DX(rhs));
47 Matrix trans = rhs.transpose();
48 D3DXMatrixMultiply(DX(res), DX(*
this), DX(trans));
54 D3DXMatrixMultiplyTranspose(DX(res), DX(rhs), DX(*
this));
61 D3DXMatrixInverse(DX(ret), det ? DX(*det) :
nullptr, DX(*
this));
67 return D3DXMatrixDeterminant(DX(*
this));
70 template<>
void Matrix<4,4,Float>::decompose( option<Vec3&> trans_, option<Quat&> rot_,
71 option<Vec3&> scale_, option<Quat&> skew)
const
74 D3DXMatrixDecompose(DX(scale), DX(rot), DX(trans), DX(*
this));
79 Real tol = scale.x * 1.0e-4;
82 decomposeSkew(trans_, rot_, scale_, skew);
88 if (trans_) trans_ = getTrans();
89 if (rot_) rot_ = rot.inverse();
90 if (scale_) scale_ = scale;
Real determinant() const
Get the determinant. Returns the pseudo-determinant if this matrix is not square. ...
Definition: Base.h:487
Float_::Real Float
float type
Definition: Float.h:61
Vec< 3, Float > Vec3_f
Definition: Vec3.h:357
Res && transposeMul(const T &rhs, Res &&res) const
Stores result in and returns res.
Definition: Base.h:341
Res && transposeMulTranspose(const T &rhs, Res &&res) const
Stores result in and returns res.
Definition: Base.h:383
Res && mul(const T &rhs, Res &&res) const
Multiply with another matrix. This mat's column size must match rhs' row size. Stores result in and r...
Definition: Base.h:161
static bool isNear(Int a, Int b, Int tol)
Check whether two numbers are near each other, given a tolerance.
Definition: Alge.h:105
static const Quat_ identity
Definition: Quat.h:347
float Real
Real number type. See Real_ for real number operations and constants.
Definition: Real.h:21
Vec< 3 > Vec3
3D column vector types
Definition: Vec3.h:356
Quat_< Real > Quat
Definition: Quat.h:353
Quat_< Float > Quat_f
Definition: Quat.h:354
Matrix< s_cols, s_rows, Real > inverse(optional< Real & > det=optnull) const
Get the pseudo-inverse of this matrix. The pseudo-determinant will be returned in det if specified...
Definition: Base.h:421
Matrix< 4, 4, Float > Matrix4_f
Definition: Matrix4.h:514
Global Honeycomb namespace.
Res && mulTranspose(const T &rhs, Res &&res) const
Stores result in and returns res.
Definition: Base.h:362