summaryrefslogtreecommitdiffstats
path: root/src/core/hid/motion_input.h
diff options
context:
space:
mode:
authorNarr the Reg <juangerman-13@hotmail.com>2023-02-22 04:47:47 +0100
committerNarr the Reg <juangerman-13@hotmail.com>2023-02-22 04:55:23 +0100
commit739a81055f8f33ab0987ee730370a0535a1bdf05 (patch)
tree8d7acb47d0b2915112f13aaa9542368cf8c5b8ce /src/core/hid/motion_input.h
parentinput_common: Implement dedicated motion from mouse (diff)
downloadyuzu-739a81055f8f33ab0987ee730370a0535a1bdf05.tar
yuzu-739a81055f8f33ab0987ee730370a0535a1bdf05.tar.gz
yuzu-739a81055f8f33ab0987ee730370a0535a1bdf05.tar.bz2
yuzu-739a81055f8f33ab0987ee730370a0535a1bdf05.tar.lz
yuzu-739a81055f8f33ab0987ee730370a0535a1bdf05.tar.xz
yuzu-739a81055f8f33ab0987ee730370a0535a1bdf05.tar.zst
yuzu-739a81055f8f33ab0987ee730370a0535a1bdf05.zip
Diffstat (limited to '')
-rw-r--r--src/core/hid/motion_input.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/core/hid/motion_input.h b/src/core/hid/motion_input.h
index 9180bb9aa..e2c1bbf95 100644
--- a/src/core/hid/motion_input.h
+++ b/src/core/hid/motion_input.h
@@ -20,6 +20,9 @@ public:
static constexpr float IsAtRestStandard = 0.01f;
static constexpr float IsAtRestThight = 0.005f;
+ static constexpr float GyroMaxValue = 5.0f;
+ static constexpr float AccelMaxValue = 7.0f;
+
explicit MotionInput();
MotionInput(const MotionInput&) = default;
@@ -40,6 +43,7 @@ public:
void EnableReset(bool reset);
void ResetRotations();
+ void ResetQuaternion();
void UpdateRotation(u64 elapsed_time);
void UpdateOrientation(u64 elapsed_time);
@@ -69,7 +73,7 @@ private:
Common::Vec3f derivative_error;
// Quaternion containing the device orientation
- Common::Quaternion<f32> quat{{0.0f, 0.0f, -1.0f}, 0.0f};
+ Common::Quaternion<f32> quat;
// Number of full rotations in each axis
Common::Vec3f rotations;