Fixed accelerometer reverting X and Y coordinates

This commit is contained in:
pelya
2010-10-18 15:49:35 +03:00
parent c0a192ea2e
commit 695077be94
4 changed files with 26 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
package org.enigmagame.enigma;
package de.schwardtnet.alienblaster;
import android.app.Activity;
import android.content.Context;
@@ -48,10 +48,7 @@ class AccelerometerReader implements SensorEventListener {
if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER)
{
if( Globals.HorizontalOrientation )
// TODO: it feels better for me to use tilt as X value instead of intuitive horizontal phone orientation
// because then I can hold device comfortably, we need another user-configurable option for that
// nativeOrientation(event.values[1], -event.values[2], event.values[0]); // Comfortable setting
nativeAccelerometer(-event.values[1], -event.values[0], event.values[2]); // Intuitive setting
nativeAccelerometer(event.values[1], -event.values[0], event.values[2]);
else
nativeAccelerometer(event.values[0], event.values[1], event.values[2]); // TODO: not tested!
}