The GameRotationVector in Android does not behave as expected from the doc (1). The Android doc says that the GameRotationVector should give the same values as the RotationVector sensor, with the difference that it does NOT consider the real azimuth (magnetic north). In this case I am talking about the azimuth which I get by the following code.
public void onSensorChanged(SensorEvent event) {
SensorManager.getRotationMatrixFromVector(rotMatrix,event.values);
SensorManager.remapCoordinateSystem(rotMatrix, SensorManager.AXIS_X, SensorManager.AXIS_Z, rotMatrixRemapped);
SensorManager.getOrientation(rotMatrixRemapped, vals);
myAzimuthInRadiant = vals[0];
}
The RotationVector sensor gives values from -pi to pi when I turned my device in 360° - everything fine, but look at the second picture.
In the second picture you can see that the GameRotationVector gives values from pi/2 to pi and vice versa on the negative site. That's, summing up = pi, which is half the range of the RotationVector.
So what is wrong here?
(1) http://developer.android.com/reference/android/hardware/Sensor.html#TYPE_GAME_ROTATION_VECTOR