summaryrefslogtreecommitdiffstats
path: root/src/core/hid
diff options
context:
space:
mode:
authorgerman77 <juangerman-13@hotmail.com>2022-01-24 04:54:33 +0100
committergerman77 <juangerman-13@hotmail.com>2022-01-24 04:54:33 +0100
commitebf19616f4698700738656ae09b0d9705566b9a1 (patch)
treebc7d846c3eb77831678b3308a2a238b3a995f2ab /src/core/hid
parentMerge pull request #7761 from v1993/patch-8 (diff)
downloadyuzu-ebf19616f4698700738656ae09b0d9705566b9a1.tar
yuzu-ebf19616f4698700738656ae09b0d9705566b9a1.tar.gz
yuzu-ebf19616f4698700738656ae09b0d9705566b9a1.tar.bz2
yuzu-ebf19616f4698700738656ae09b0d9705566b9a1.tar.lz
yuzu-ebf19616f4698700738656ae09b0d9705566b9a1.tar.xz
yuzu-ebf19616f4698700738656ae09b0d9705566b9a1.tar.zst
yuzu-ebf19616f4698700738656ae09b0d9705566b9a1.zip
Diffstat (limited to 'src/core/hid')
-rw-r--r--src/core/hid/emulated_controller.cpp1
-rw-r--r--src/core/hid/motion_input.cpp4
2 files changed, 3 insertions, 2 deletions
diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp
index d12037b11..a7cdf45e6 100644
--- a/src/core/hid/emulated_controller.cpp
+++ b/src/core/hid/emulated_controller.cpp
@@ -749,6 +749,7 @@ void EmulatedController::SetMotion(const Common::Input::CallbackStatus& callback
raw_status.gyro.y.value,
raw_status.gyro.z.value,
});
+ emulated.SetGyroThreshold(raw_status.gyro.x.properties.threshold);
emulated.UpdateRotation(raw_status.delta_timestamp);
emulated.UpdateOrientation(raw_status.delta_timestamp);
force_update_motion = raw_status.force_update;
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 {
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;