Accelerometer values convert to screen space

The currently implemented version doesn’t rotate when I’m using sensorLandscape.

Please check this: http://developer.download.nvidia.com/tegra/docs/tegra_android_accelerometer_v5f.pdf
I think this is a more general solution.

Also note that while most event are sent to the native code on the render thread (using surfaceview’s queueevent)
the onSensorChanged simply calls the native onSensorChanged on the “sensor” thread.

I’ve replaced the current transform code with this: (using the nvidia’s method).
It worked for me (on Zte Blade with sensorlandscape) but obviously needs further testing.
@

float x = 0.0f;
float y = 0.0f;
float z = event.values[2];
/*
* Because the axes are not swapped when the device’s screen orientation changes.
* So we should swap it here.
* In tablets such as Motorola Xoom, the default orientation is landscape, so should
* consider this.
/
int rotationIndex = mWindowMgr.getDefaultDisplay.getRotation;
if
{
x = 1.0f
event.values[0];
y = ~~1.0f * event.values[1];
}
else if
{
x =~~1.0f * event.values[1];
y = ~~1.0f * event.values[0];
}
else if
{
x =~~1.0f * event.values[0];
y = 1.0f * event.values[1];
}
else if (rotationIndex == Surface.ROTATION_270)
{
x = 1.0f * event.values[1];
y = 1.0f * event.values[0];
}
@