I have two entities A and B which both have a rotation quaternion and a translation vector. I transform entity A by entity B like this:
A.rotation *= B.rotation
A.translation *= inverse(B.rotation)
A.translation += B.translation
Instead of applying these transformations on the entity's translation and rotation components, I would like to create matrices from these components and apply the transformations on the resulting matrices:
A.matrix = mat4(A.rotation) * mat4(A.position)
B.matrix = mat4(B.rotation) * mat4(B.position)
A.matrix *= ???
Is that possible? I'm asking because I want to hide the translation and rotation components and only give access to the combined translation-rotation matrix.
Thank you!