I may have encountered a bug, but I'm not sure, maybe this is the way quaternions work.
I try to calculate the models roatation based on the camera angle, the angle of the analog stick, the model angle and the time.
So far my code works out well as long as my model keeps being rotated between 0 and 180 degrees (counterclockwise, along y-Axis, y-Up). To get the ModelInstance's rotation (still along y) I use
Quaternion quatRotation = new Quaternion; modelInstance.transform.getRotation(quatRotation); float rotation = quatRotation.getAxisAngle(new Vector3 (0f, 1f, 0f)) % 360f;
but rotation is always between 0f and 180f. Even if I'd expect (because I see it on my display) the value to be e.g. -6f it still is 6f. So basically the rotation gets mirrored along x-Axis.
Do I do anything wrong or is this a bug within libGDX?
Thanks in advance