I am writing a 3D math library for general game development and want to know what type of matrix classes I should include. Is just a 4x4 matrix enough, or must I provide 3x4 and dedicated rotational matrices?
According to this
In order to use the vector registers of modern CPUs (SSE, Altivec, SPUs) you have to pass 4x 32 bit floats anyway (its a 128 bit register), plus you have to take care of the alignment, usually 16 bytes. So you don't have the chance to safe the space for the 4th component anyway.
and from Game Engine Architecture
The rightmost column of an aﬃ ne 4 × 4 matrix always contains the vector [ 0 0 0 1 ]T . As such, game programmers oft en omit the fourth column to save memory. You’ll encounter 4 × 3 aﬃne matrices frequently in game math libraries.
Since 4x3 matrices are just created for convenience and since you need 128 bits to use the vector register, would it be best to just have a single 4x4 matrix class handle all needed matrix operations?