diff options
author | Narr the Reg <juangerman-13@hotmail.com> | 2023-02-10 02:05:20 +0100 |
---|---|---|
committer | Narr the Reg <juangerman-13@hotmail.com> | 2023-02-10 02:07:50 +0100 |
commit | 5e9fa5def5cf5ae3f00cc354a0b1363123dc6930 (patch) | |
tree | 90a707a21b66803010bbe707c36563e1ff583559 /src/core/hid/motion_input.h | |
parent | service: hid: Return error if arguments of SetSupportedNpadIdType is invalid (diff) | |
download | yuzu-5e9fa5def5cf5ae3f00cc354a0b1363123dc6930.tar yuzu-5e9fa5def5cf5ae3f00cc354a0b1363123dc6930.tar.gz yuzu-5e9fa5def5cf5ae3f00cc354a0b1363123dc6930.tar.bz2 yuzu-5e9fa5def5cf5ae3f00cc354a0b1363123dc6930.tar.lz yuzu-5e9fa5def5cf5ae3f00cc354a0b1363123dc6930.tar.xz yuzu-5e9fa5def5cf5ae3f00cc354a0b1363123dc6930.tar.zst yuzu-5e9fa5def5cf5ae3f00cc354a0b1363123dc6930.zip |
Diffstat (limited to 'src/core/hid/motion_input.h')
-rw-r--r-- | src/core/hid/motion_input.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/core/hid/motion_input.h b/src/core/hid/motion_input.h index f5fd90db5..9180bb9aa 100644 --- a/src/core/hid/motion_input.h +++ b/src/core/hid/motion_input.h @@ -11,6 +11,15 @@ namespace Core::HID { class MotionInput { public: + static constexpr float ThresholdLoose = 0.01f; + static constexpr float ThresholdStandard = 0.007f; + static constexpr float ThresholdThight = 0.002f; + + static constexpr float IsAtRestRelaxed = 0.05f; + static constexpr float IsAtRestLoose = 0.02f; + static constexpr float IsAtRestStandard = 0.01f; + static constexpr float IsAtRestThight = 0.005f; + explicit MotionInput(); MotionInput(const MotionInput&) = default; @@ -26,6 +35,9 @@ public: void SetGyroBias(const Common::Vec3f& bias); void SetGyroThreshold(f32 threshold); + /// Applies a modifier on top of the normal gyro threshold + void SetUserGyroThreshold(f32 threshold); + void EnableReset(bool reset); void ResetRotations(); @@ -74,6 +86,9 @@ private: // Minimum gyro amplitude to detect if the device is moving f32 gyro_threshold = 0.0f; + // Multiplies gyro_threshold by this value + f32 user_gyro_threshold = 0.0f; + // Number of invalid sequential data u32 reset_counter = 0; |