|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectandroid.gameengine.icadroids.input.MotionSensor
public class MotionSensor
Motion Sensor is used to receive certain statics about certain
motionEvent note that this only works on real phones and not in
emulator. Some of these functions will not work if you do not have
the required sensor in your phone.
Use of MotionSensor in your game: use the static variables to read
the state of the sensors. All other methods are for communication
between game engine and android device.
Field Summary | |
---|---|
static float |
pitch
the y rotation of the phone |
static float |
roll
the z rotation of the phone |
static boolean |
tiltDown
this var is TRUE when the phone has been tilted Down |
static boolean |
tiltLeft
this var is TRUE when the phone has been tilted Left |
static boolean |
tiltRight
this var is TRUE when the phone has been tilted Right |
static boolean |
tiltUp
this var is TRUE when the phone has been tilted Up |
static boolean |
use
Set this to TRUE if you want to use the MotionSensor and be able to ask for input. |
static float |
xAcceleration
This variable contains the x Acceleration of the phone. |
static float |
yAcceleration
This variable contains the y Acceleration of the phone. |
static float |
yaw
the x rotation of the phone |
static float |
zAcceleration
This variable contains the Z Acceleration of the phone , minus the gravity |
Constructor Summary | |
---|---|
MotionSensor()
|
Method Summary | |
---|---|
static void |
handleOnPause(SensorEventListener listener)
DO NOT CALL THIS METHOD. |
static void |
handleOnResume(SensorEventListener listener)
DO NOT CALL THIS METHOD. |
static void |
handleSensorChange(SensorEvent event)
DO NOT CALL THIS METHOD. |
static void |
initialize(SensorManager newSensorManager)
Start the MotionSensor. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static boolean use
public static float xAcceleration
public static float yAcceleration
public static float zAcceleration
public static float yaw
public static float pitch
public static float roll
public static boolean tiltUp
public static boolean tiltDown
public static boolean tiltLeft
public static boolean tiltRight
Constructor Detail |
---|
public MotionSensor()
Method Detail |
---|
public static void initialize(SensorManager newSensorManager)
newSensorManager
- public static void handleOnResume(SensorEventListener listener)
This method is called by the game engine to handle listening to sensor events.
listener
- public static void handleOnPause(SensorEventListener listener)
This method is called by the game engine to handle listening to sensor events.
listener
- public static void handleSensorChange(SensorEvent event)
This method is called by the game engine to handle sensor events.
event
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |