diff options
| author | 2020-10-03 22:22:01 -0500 | |
|---|---|---|
| committer | 2020-10-03 22:22:01 -0500 | |
| commit | a220d8799ed332c1d8f2231b18079b1210511bcd (patch) | |
| tree | a3fd52115f177514a5b2ff2e86326f9cd4e2b294 /src/input_common/motion_input.h | |
| parent | Merge pull request #4291 from german77/ImplementControllerRumble (diff) | |
| download | yuzu-a220d8799ed332c1d8f2231b18079b1210511bcd.tar.gz yuzu-a220d8799ed332c1d8f2231b18079b1210511bcd.tar.xz yuzu-a220d8799ed332c1d8f2231b18079b1210511bcd.zip | |
Add compatibility with only accelerometer and auto calibrate for drift
Diffstat (limited to 'src/input_common/motion_input.h')
| -rw-r--r-- | src/input_common/motion_input.h | 6 |
1 files changed, 4 insertions, 2 deletions
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: | |||
| 29 | void EnableReset(bool reset); | 29 | void EnableReset(bool reset); |
| 30 | void ResetRotations(); | 30 | void ResetRotations(); |
| 31 | 31 | ||
| 32 | void UpdateRotation(u64 elapsed_time); | 32 | void UpdateRotation(const u64 elapsed_time); |
| 33 | void UpdateOrientation(u64 elapsed_time); | 33 | void UpdateOrientation(const u64 elapsed_time); |
| 34 | 34 | ||
| 35 | std::array<Common::Vec3f, 3> GetOrientation() const; | 35 | std::array<Common::Vec3f, 3> GetOrientation() const; |
| 36 | Common::Vec3f GetAcceleration() const; | 36 | Common::Vec3f GetAcceleration() const; |
| @@ -43,6 +43,7 @@ public: | |||
| 43 | 43 | ||
| 44 | private: | 44 | private: |
| 45 | void ResetOrientation(); | 45 | void ResetOrientation(); |
| 46 | void SetOrientationFromAccelerometer(); | ||
| 46 | 47 | ||
| 47 | // PID constants | 48 | // PID constants |
| 48 | const f32 kp; | 49 | const f32 kp; |
| @@ -63,6 +64,7 @@ private: | |||
| 63 | f32 gyro_threshold = 0.0f; | 64 | f32 gyro_threshold = 0.0f; |
| 64 | u32 reset_counter = 0; | 65 | u32 reset_counter = 0; |
| 65 | bool reset_enabled = true; | 66 | bool reset_enabled = true; |
| 67 | bool only_accelerometer = true; | ||
| 66 | }; | 68 | }; |
| 67 | 69 | ||
| 68 | } // namespace InputCommon | 70 | } // namespace InputCommon |