Game Development Reference
In-Depth Information
is made by swapping its rows and columns:
cf i
M =
If M is a rotation matrix, then
M =
M 1
We can implement this for our 3
3 matrix in this way:
Excerpt from include/cyclone/core.h
* Holds an inertia tensor, consisting of a 3x3 row-major matrix.
* This matrix is not padding to produce an aligned structure, since
* it is most commonly used with a mass (single real) and two
* damping coefficients to make the 12-element characteristics array
* of a rigid body.
class Matrix3
// ... Other Matrix3 code as before ...
* Sets the matrix to be the transpose of the given matrix.
* @param m The matrix to transpose and use to set this.
void setTranspose(const Matrix3 &m)
data[0] =[0];
data[1] =[3];
data[2] =[6];
data[3] =[1];
data[4] =[4];
data[5] =[7];
data[6] =[2];
data[7] =[5];
data[8] =[8];
/** Returns a new matrix containing the transpose of this matrix. */
Matrix3 transpose() const
Matrix3 result;
Search Nedrilad ::

Custom Search