I have GameObject's transform component(position+rotation) and shape mesh(array of vertices).
On each game tick I update coordinates of vertices relatively to game object's rotation.
And my current algorithm for this is:
foreach vertice {
Mat4 m = createIdentityMatrix();
rotateMatrixByAngle(m, angle, axis);
(Vec3) vertice * m;
}
The problem is, that I always need to create new identity matrix and rotate it by current angle of rotation, even if it's not changed from previous tick. I think that measuring delta rotation from previous tick is not a solution. And I would like to know, if there is proper approach of rotation.
Maybe I should store transform rotation data in a matrix? But that sounds crazy and odd.