diff options
| author | bunnei <bunneidev@gmail.com> | 2022-01-27 15:44:04 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-27 15:44:04 -0800 |
| commit | 584eb04402a68dd88a70c57cc9f69bef26147ba0 (patch) | |
| tree | d2e4a7350ca7362b01e5ff6a16fd25f3fbdb279c /src/core/hid/motion_input.cpp | |
| parent | 6c0cc7303f3b6a77ef1e27f1f06aa123cdcf20bb (diff) | |
| parent | 1fca7203d3d6c01bb1332f873b0b7bc4f269c02d (diff) | |
Merge pull request #7770 from german77/motion-threshold
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 6e126be19d..05042fd991 100644 --- a/src/core/hid/motion_input.cpp +++ b/src/core/hid/motion_input.cpp @@ -10,7 +10,7 @@ namespace Core::HID { MotionInput::MotionInput() { // Initialize PID constants with default values SetPID(0.3f, 0.005f, 0.0f); - SetGyroThreshold(0.00005f); + SetGyroThreshold(0.007f); } void MotionInput::SetPID(f32 new_kp, f32 new_ki, f32 new_kd) { @@ -31,7 +31,7 @@ void MotionInput::SetGyroscope(const Common::Vec3f& gyroscope) { gyro_bias = (gyro_bias * 0.9999f) + (gyroscope * 0.0001f); } - if (gyro.Length2() < gyro_threshold) { + if (gyro.Length() < gyro_threshold) { gyro = {}; } else { only_accelerometer = false; |
