Hi,
I want to make a character model look up/down (like by using Chr.input.turn.y = 1) based on input from a server.
The MMO does something similar to make a character turn when it does:
Code:
Matrix matrix;
matrix.orn().setRotateY(ANGLE_X_RECEIVED_FROM_SERVER);
I tried transmitting Chr.angle.y and using that to do:
Code:
Matrix matrix;
matrix.orn().setRotateY(ANGLE_X_RECEIVED_FROM_SERVER).rotateX(ANGLE_Y_RECEIVED_FROM_SERVER);
However, that rotates the entire model rather than just the character's head and seems to move it on a weird axis.
Any clues? It feels like it should be fairly simple, but I haven't a clue what I'm missing.
I actually managed to get something a bit closer by doing this:
Code:
Orient &head = cskel.getBone("body").orn;
head *= Matrix3().setRotateX(ANGLE_Y_RECEIVED_FROM_SERVER);
But it's not quite the same, and requires me to call updateMatrix twice (once after setRotateY and once for the body rotation). How does the engine do it?