aboutsummaryrefslogtreecommitdiff
path: root/src/core/hid/motion_input.h
diff options
context:
space:
mode:
authorgerman77 <juangerman-13@hotmail.com>2021-11-01 19:49:14 -0600
committerNarr the Reg <juangerman-13@hotmail.com>2021-11-24 20:30:27 -0600
commit136eb9c4c2b2425c2dd45a79cf444dee7170714d (patch)
tree74a055a08126fdd33b2071baa08125177847db6e /src/core/hid/motion_input.h
parent77fa4d4bf60526826ef8b53ee3870f7d2a761976 (diff)
core/hid: Fully emulate motion from button
Diffstat (limited to 'src/core/hid/motion_input.h')
-rw-r--r--src/core/hid/motion_input.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/core/hid/motion_input.h b/src/core/hid/motion_input.h
index 3deef5ac3..5b5b420bb 100644
--- a/src/core/hid/motion_input.h
+++ b/src/core/hid/motion_input.h
@@ -56,15 +56,31 @@ private:
Common::Vec3f integral_error;
Common::Vec3f derivative_error;
+ // Quaternion containing the device orientation
Common::Quaternion<f32> quat{{0.0f, 0.0f, -1.0f}, 0.0f};
+
+ // Number of full rotations in each axis
Common::Vec3f rotations;
+
+ // Acceleration vector measurement in G force
Common::Vec3f accel;
+
+ // Gyroscope vector measurement in radians/s.
Common::Vec3f gyro;
+
+ // Vector to be substracted from gyro measurements
Common::Vec3f gyro_drift;
+ // Minimum gyro amplitude to detect if the device is moving
f32 gyro_threshold = 0.0f;
+
+ // Number of invalid sequential data
u32 reset_counter = 0;
+
+ // If the provided data is invalid the device will be autocalibrated
bool reset_enabled = true;
+
+ // Use accelerometer values to calculate position
bool only_accelerometer = true;
};