am 7bf70dd1: Merge "Fix alpha value for device orientation" into jb-mr1-dev

* commit '7bf70dd1ac9f1e6968a34d44f7e546a92b08cb58':
  Fix alpha value for device orientation
This commit is contained in:
Steve Block
2012-08-16 04:59:14 -07:00
committed by Android Git Automerger

View File

@@ -123,7 +123,7 @@ final class DeviceOrientationService implements SensorEventListener {
// The angles are in radians
float[] rotationAngles = new float[3];
SensorManager.getOrientation(deviceRotationMatrix, rotationAngles);
double alpha = Math.toDegrees(-rotationAngles[0]) - 90.0;
double alpha = Math.toDegrees(-rotationAngles[0]);
while (alpha < 0.0) { alpha += 360.0; } // [0, 360)
double beta = Math.toDegrees(-rotationAngles[1]);
while (beta < -180.0) { beta += 360.0; } // [-180, 180)