diff options
| author | 2022-01-23 21:54:33 -0600 | |
|---|---|---|
| committer | 2022-01-23 21:54:33 -0600 | |
| commit | ebf19616f4698700738656ae09b0d9705566b9a1 (patch) | |
| tree | bc7d846c3eb77831678b3308a2a238b3a995f2ab /src/core/hid/motion_input.cpp | |
| parent | Merge pull request #7761 from v1993/patch-8 (diff) | |
| download | yuzu-ebf19616f4698700738656ae09b0d9705566b9a1.tar.gz yuzu-ebf19616f4698700738656ae09b0d9705566b9a1.tar.xz yuzu-ebf19616f4698700738656ae09b0d9705566b9a1.zip | |
input_common: Add option to configure gyro threshold
Diffstat (limited to 'src/core/hid/motion_input.cpp')
| -rw-r--r-- | src/core/hid/motion_input.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/hid/motion_input.cpp b/src/core/hid/motion_input.cpp index 6e126be19..05042fd99 100644 --- a/src/core/hid/motion_input.cpp +++ b/src/core/hid/motion_input.cpp | |||
| @@ -10,7 +10,7 @@ namespace Core::HID { | |||
| 10 | MotionInput::MotionInput() { | 10 | MotionInput::MotionInput() { |
| 11 | // Initialize PID constants with default values | 11 | // Initialize PID constants with default values |
| 12 | SetPID(0.3f, 0.005f, 0.0f); | 12 | SetPID(0.3f, 0.005f, 0.0f); |
| 13 | SetGyroThreshold(0.00005f); | 13 | SetGyroThreshold(0.007f); |
| 14 | } | 14 | } |
| 15 | 15 | ||
| 16 | void MotionInput::SetPID(f32 new_kp, f32 new_ki, f32 new_kd) { | 16 | void MotionInput::SetPID(f32 new_kp, f32 new_ki, f32 new_kd) { |
| @@ -31,7 +31,7 @@ void MotionInput::SetGyroscope(const Common::Vec3f& gyroscope) { | |||
| 31 | gyro_bias = (gyro_bias * 0.9999f) + (gyroscope * 0.0001f); | 31 | gyro_bias = (gyro_bias * 0.9999f) + (gyroscope * 0.0001f); |
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | if (gyro.Length2() < gyro_threshold) { | 34 | if (gyro.Length() < gyro_threshold) { |
| 35 | gyro = {}; | 35 | gyro = {}; |
| 36 | } else { | 36 | } else { |
| 37 | only_accelerometer = false; | 37 | only_accelerometer = false; |