This commit is contained in:
Atul 2022-03-21 22:05:22 +00:00 committed by GitHub
commit 8ce4905a79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -205,7 +205,6 @@ public class MainActivity extends com.google.mediapipe.apps.basic.MainActivity {
currentSticker = null; currentSticker = null;
SensorManager sensorManager = (SensorManager) getSystemService(SENSOR_SERVICE); SensorManager sensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);
List<Sensor> sensorList = sensorManager.getSensorList(Sensor.TYPE_ROTATION_VECTOR);
sensorManager.registerListener( sensorManager.registerListener(
new SensorEventListener() { new SensorEventListener() {
private final float[] rotMatFromVec = new float[9]; private final float[] rotMatFromVec = new float[9];
@ -224,7 +223,7 @@ public class MainActivity extends com.google.mediapipe.apps.basic.MainActivity {
rotMatFromVec, SensorManager.AXIS_MINUS_X, SensorManager.AXIS_Y, rotationMatrix); rotMatFromVec, SensorManager.AXIS_MINUS_X, SensorManager.AXIS_Y, rotationMatrix);
} }
}, },
(Sensor) sensorList.get(0), sensorManager.getDefaultSensor(Sensor.TYPE_ROTATION_VECTOR),
SENSOR_SAMPLE_DELAY); SENSOR_SAMPLE_DELAY);
// Mechanisms for zoom, pinch, rotation, tap gestures // Mechanisms for zoom, pinch, rotation, tap gestures