1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-06 12:20:30 +00:00

Align sensors and implement gravity sensor for Android

This commit is contained in:
Bastiaan Olij
2017-11-11 09:42:23 +11:00
parent 19b1ff0fc5
commit 6205eb40e7
8 changed files with 39 additions and 14 deletions

View File

@@ -156,17 +156,6 @@ void MobileVRInterface::set_position_from_sensors() {
has_gyro = true;
};
#ifdef ANDROID_ENABLED
///@TODO needs testing, i don't have a gyro, potentially can be removed depending on what comes out of issue #8101
// On Android x and z axis seem inverted
gyro.x = -gyro.x;
gyro.z = -gyro.z;
grav.x = -grav.x;
grav.z = -grav.z;
magneto.x = -magneto.x;
magneto.z = -magneto.z;
#endif
if (has_gyro) {
// start with applying our gyro (do NOT smooth our gyro!)
Basis rotate;