public Joystick loadJoystick(int joyId, InputManager inputManager) {
        SensorData sensorData;
        AndroidSensorJoystickAxis axis;

        AndroidSensorJoystick joystick = new AndroidSensorJoystick(inputManager,
                                    joyInput,
                                    joyId,
                                    "AndroidSensorsJoystick");

        List<Sensor> availSensors = sensorManager.getSensorList(Sensor.TYPE_ALL);
        if (logger.isLoggable(Level.FINE)) {
            for (Sensor sensor : availSensors) {
                logger.log(Level.FINE, "{0} Sensor is available, Type: {1}, Vendor: {2}, Version: {3}",
                        new Object[]{sensor.getName(), sensor.getType(), sensor.getVendor(), sensor.getVersion()});
            }
        }

        // manually create orientation sensor data since orientation is not a physical sensor
        sensorData = new SensorData(Sensor.TYPE_ORIENTATION, null);
        sensorData.lastValues = new float[3];
        sensors.put(Sensor.TYPE_ORIENTATION, sensorData);
        axis = joystick.addAxis(SensorJoystickAxis.ORIENTATION_X, SensorJoystickAxis.ORIENTATION_X, joystick.getAxisCount(), FastMath.HALF_PI);
        joystick.setYAxis(axis); // joystick y axis = rotation around device x axis
        sensorData.axes.add(axis);
        axis = joystick.addAxis(SensorJoystickAxis.ORIENTATION_Y, SensorJoystickAxis.ORIENTATION_Y, joystick.getAxisCount(), FastMath.HALF_PI);
        joystick.setXAxis(axis); // joystick x axis = rotation around device y axis
        sensorData.axes.add(axis);
        axis = joystick.addAxis(SensorJoystickAxis.ORIENTATION_Z, SensorJoystickAxis.ORIENTATION_Z, joystick.getAxisCount(), FastMath.HALF_PI);
        sensorData.axes.add(axis);

        // add axes for physical sensors
        sensorData = initSensor(Sensor.TYPE_MAGNETIC_FIELD);
        if (sensorData != null) {
            sensorData.lastValues = new float[3];
            sensors.put(Sensor.TYPE_MAGNETIC_FIELD, sensorData);
//            axis = joystick.addAxis(SensorJoystickAxis.MAGNETIC_X, "MagneticField_X", joystick.getAxisCount(), 1f);
//            sensorData.axes.add(axis);
//            axis = joystick.addAxis(SensorJoystickAxis.MAGNETIC_Y, "MagneticField_Y", joystick.getAxisCount(), 1f);
//            sensorData.axes.add(axis);
//            axis = joystick.addAxis(SensorJoystickAxis.MAGNETIC_Z, "MagneticField_Z", joystick.getAxisCount(), 1f);
//            sensorData.axes.add(axis);
        }

        sensorData = initSensor(Sensor.TYPE_ACCELEROMETER);
        if (sensorData != null) {
            sensorData.lastValues = new float[3];
            sensors.put(Sensor.TYPE_ACCELEROMETER, sensorData);
//            axis = joystick.addAxis(SensorJoystickAxis.ACCELEROMETER_X, "Accelerometer_X", joystick.getAxisCount(), 1f);
//            sensorData.axes.add(axis);
//            axis = joystick.addAxis(SensorJoystickAxis.ACCELEROMETER_Y, "Accelerometer_Y", joystick.getAxisCount(), 1f);
//            sensorData.axes.add(axis);
//            axis = joystick.addAxis(SensorJoystickAxis.ACCELEROMETER_Z, "Accelerometer_Z", joystick.getAxisCount(), 1f);
//            sensorData.axes.add(axis);
        }

//        sensorData = initSensor(Sensor.TYPE_GYROSCOPE);
//        if (sensorData != null) {
//            sensorData.lastValues = new float[3];
//        }
//
//        sensorData = initSensor(Sensor.TYPE_GRAVITY);
//        if (sensorData != null) {
//            sensorData.lastValues = new float[3];
//        }
//
//        sensorData = initSensor(Sensor.TYPE_LINEAR_ACCELERATION);
//        if (sensorData != null) {
//            sensorData.lastValues = new float[3];
//        }
//
//        sensorData = initSensor(Sensor.TYPE_ROTATION_VECTOR);
//        if (sensorData != null) {
//            sensorData.lastValues = new float[4];
//        }
//
//        sensorData = initSensor(Sensor.TYPE_PROXIMITY);
//        if (sensorData != null) {
//            sensorData.lastValues = new float[1];
//        }
//
//        sensorData = initSensor(Sensor.TYPE_LIGHT);
//        if (sensorData != null) {
//            sensorData.lastValues = new float[1];
//        }
//
//        sensorData = initSensor(Sensor.TYPE_PRESSURE);
//        if (sensorData != null) {
//            sensorData.lastValues = new float[1];
//        }
//
//        sensorData = initSensor(Sensor.TYPE_TEMPERATURE);
//        if (sensorData != null) {
//            sensorData.lastValues = new float[1];
//        }


        loaded = true;
        return joystick;
    }
Calculates the device orientation based off the data received from the
Acceleration Sensor and Magnetic Field sensor
Values are returned relative to the Earth.

From the Android Doc

Computes the device's orientation based on the rotation matrix. When it returns, the array values is filled with the result:
 values[0]: azimuth, rotation around the Z axis.
 values[1]: pitch, rotation around the X axis.
 values[2]: roll, rotation around the Y axis.

The reference coordinate-system used is different from the world
coordinate-system defined for the rotation matrix:
 X is defined as the vector product Y.Z (It is tangential to the ground at the device's current location and roughly points West).
 Y is tangential to the ground at the device's current location and points towards the magnetic North Pole.
 Z points towards the center of the Earth and is perpendicular to the ground.

@return True if Orientation was calculated
jme3-android/src/main/java/com/jme3/input/android/AndroidSensorJoyInput.java