I was just trying to decide whether to use FTransform or FMatrix for a TMap.
Intutively I thought sizeof(FMatrix) would be less than Sizeof(FTransform) – But when I logged them out -
SizeOf(FMatrix) = 64 bytes
Sizeof(FTransform) = 48 bytes
Can someone explain the size consideration behind it? I get that FTransform has Scale, Translation and Rotation and can converted to a Matrix. So How and why is FTransform a better option than FMatrix.
So float are 32-bit which is 4 bytes. FMatrix is have 4 by 4 axis (=64 bytes) of floats while FTransform has 3 variables while only Rotation on stored as FQuat is 4 a while translate and scale is stored in 3 axis float since 4th axis is irrelevant for parameters to use with matrix transforms. 4*(4+3+3) = 40 (not sure where that 8 bytes come from looking on refrence)
In game logic FTransfrom is better option because readability, actors need to store it like that as people using UE4 won’t able to operate them, matrix with mix up all transform is not readable. Also fact you don’t need to convert back and forth on each step, while matrixes are start become needed while rendering. And as you discovered yourself, smaller memory size too.