Initialize sensors to default values for Android platform
This commit is contained in:
parent
f5b95f0f81
commit
21d03317d7
@ -379,6 +379,13 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC
|
|||||||
mGyroscope = mSensorManager.getDefaultSensor(Sensor.TYPE_GYROSCOPE);
|
mGyroscope = mSensorManager.getDefaultSensor(Sensor.TYPE_GYROSCOPE);
|
||||||
mSensorManager.registerListener(this, mGyroscope, SensorManager.SENSOR_DELAY_GAME);
|
mSensorManager.registerListener(this, mGyroscope, SensorManager.SENSOR_DELAY_GAME);
|
||||||
|
|
||||||
|
// Since there is no way to poll sensors themselves to get actual values
|
||||||
|
// we initialize them to 0
|
||||||
|
GodotLib.accelerometer(0, 0, 0);
|
||||||
|
GodotLib.gravity(0, 0, 0);
|
||||||
|
GodotLib.magnetometer(0, 0, 0);
|
||||||
|
GodotLib.gyroscope(0, 0, 0);
|
||||||
|
|
||||||
result_callback = null;
|
result_callback = null;
|
||||||
|
|
||||||
mPaymentsManager = PaymentsManager.createManager(this).initService();
|
mPaymentsManager = PaymentsManager.createManager(this).initService();
|
||||||
|
Loading…
Reference in New Issue
Block a user