Game Development Reference
* of a rigid body.
* Holds the tensor matrix data in array form.
and for Matrix4 it looks like this:
Excerpt from include/cyclone/core.h
* Holds a transform matrix, consisting of a rotation matrix and
* a position. The matrix has 12 elements; it is assumed that the
* remaining four are (0,0,0,1), producing a homogenous matrix.
* Holds the transform matrix data in array form.
Clearly there is nothing taxing so far; we just have two arrays of numbers.
Just as we did for the Vector3 class in chapter 2, we can add methods to these
classes to implement their mathematics.
M ATRIX M ULTIPLICATION
Since I've said that matrices exist mainly to transform vectors, let's look at this first.
We transform a vector by multiplying it by the matrix
which is often called “post-multiplication” because the vector occurs after the matrix
in the multiplication.
Matrix multiplication works in the same way whether we are multiplying two
matrices together or multiplying a matrix and a vector. In fact we can think of a
vector as simply a matrix with a single column—a 3