aboutsummaryrefslogtreecommitdiff
path: root/src/core/hid/motion_input.h
diff options
context:
space:
mode:
authorNarr the Reg <juangerman-13@hotmail.com>2023-02-21 21:47:47 -0600
committerNarr the Reg <juangerman-13@hotmail.com>2023-02-21 21:55:23 -0600
commit739a81055f8f33ab0987ee730370a0535a1bdf05 (patch)
tree8d7acb47d0b2915112f13aaa9542368cf8c5b8ce /src/core/hid/motion_input.h
parent673accd630be88fde4b6b748608a9c3bc42ea60f (diff)
core: hid: Restore motion state on refresh and clamp motion values
Diffstat (limited to 'src/core/hid/motion_input.h')
-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;