From a220d8799ed332c1d8f2231b18079b1210511bcd Mon Sep 17 00:00:00 2001 From: german Date: Sat, 3 Oct 2020 22:22:01 -0500 Subject: Add compatibility with only accelerometer and auto calibrate for drift --- src/input_common/motion_input.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/input_common/motion_input.h') diff --git a/src/input_common/motion_input.h b/src/input_common/motion_input.h index 54b4439d9..f6c1fece7 100644 --- a/src/input_common/motion_input.h +++ b/src/input_common/motion_input.h @@ -29,8 +29,8 @@ public: void EnableReset(bool reset); void ResetRotations(); - void UpdateRotation(u64 elapsed_time); - void UpdateOrientation(u64 elapsed_time); + void UpdateRotation(const u64 elapsed_time); + void UpdateOrientation(const u64 elapsed_time); std::array GetOrientation() const; Common::Vec3f GetAcceleration() const; @@ -43,6 +43,7 @@ public: private: void ResetOrientation(); + void SetOrientationFromAccelerometer(); // PID constants const f32 kp; @@ -63,6 +64,7 @@ private: f32 gyro_threshold = 0.0f; u32 reset_counter = 0; bool reset_enabled = true; + bool only_accelerometer = true; }; } // namespace InputCommon -- cgit v1.2.3