|
D3DXMatrixInverse通常用来求视图矩阵的逆阵,但是donuts4中这一段是什么用意呢?
float Ixx, Iyy, Izz;
Ixx = m_fMass/12.0f * (fWidth*fWidth + fLength*fLength);
Iyy = m_fMass/12.0f * (fHeight*fHeight + fLength*fLength);
Izz = m_fMass/12.0f * (fWidth*fWidth + fHeight*fHeight);
D3DXMATRIX mInertia;
D3DXMatrixIdentity( &mInertia );
mInertia._11 = Ixx;
mInertia._22 = Iyy;
mInertia._33 = Izz;
// Store the inverse of the inertia tensor
D3DXMatrixInverse( &m_mInertiaInv, NULL, &mInertia );
还是不明白D3DXMatrixInverse的灵活运用!!
|
|