List of usage examples for com.badlogic.gdx Input getAccelerometerX
public float getAccelerometerX();
From source file:com.digitale.screens.GameLoop.java
License:Open Source License
/** * @param input//from w ww . j ava2 s . c o m */ public void accellerometer(Input input) { // accelerometer if (input.getAccelerometerY() < -Stardust3d.deadzoneX || input.getAccelerometerY() > Stardust3d.deadzoneX) Ship.yawAngle -= (input.getAccelerometerY() * Stardust3d.accelXsensitivity); if (input.getAccelerometerX() < 4 - Stardust3d.deadzoneY) { Ship.pitchAngle -= Math.abs(input.getAccelerometerX() - (4 - Stardust3d.deadzoneY)) * Stardust3d.accelYsensitivity; } else if (input.getAccelerometerX() > 5 + Stardust3d.deadzoneY) { Ship.pitchAngle += Math.abs(input.getAccelerometerX() - (5 + Stardust3d.deadzoneY)) * Stardust3d.accelYsensitivity; } }