diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/input_common/CMakeLists.txt | 4 | ||||
| -rw-r--r-- | src/input_common/motion_from_button.cpp | 34 | ||||
| -rw-r--r-- | src/input_common/motion_from_button.h | 25 | ||||
| -rw-r--r-- | src/input_common/motion_input.cpp | 307 | ||||
| -rw-r--r-- | src/input_common/motion_input.h | 74 |
5 files changed, 0 insertions, 444 deletions
diff --git a/src/input_common/CMakeLists.txt b/src/input_common/CMakeLists.txt index 8cdcd315b..d4fa69a77 100644 --- a/src/input_common/CMakeLists.txt +++ b/src/input_common/CMakeLists.txt | |||
| @@ -27,10 +27,6 @@ add_library(input_common STATIC | |||
| 27 | input_poller.h | 27 | input_poller.h |
| 28 | main.cpp | 28 | main.cpp |
| 29 | main.h | 29 | main.h |
| 30 | motion_from_button.cpp | ||
| 31 | motion_from_button.h | ||
| 32 | motion_input.cpp | ||
| 33 | motion_input.h | ||
| 34 | ) | 30 | ) |
| 35 | 31 | ||
| 36 | if (MSVC) | 32 | if (MSVC) |
diff --git a/src/input_common/motion_from_button.cpp b/src/input_common/motion_from_button.cpp deleted file mode 100644 index 29045a673..000000000 --- a/src/input_common/motion_from_button.cpp +++ /dev/null | |||
| @@ -1,34 +0,0 @@ | |||
| 1 | // Copyright 2020 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "input_common/motion_from_button.h" | ||
| 6 | #include "input_common/motion_input.h" | ||
| 7 | |||
| 8 | namespace InputCommon { | ||
| 9 | |||
| 10 | class MotionKey final : public Input::MotionDevice { | ||
| 11 | public: | ||
| 12 | using Button = std::unique_ptr<Input::ButtonDevice>; | ||
| 13 | |||
| 14 | explicit MotionKey(Button key_) : key(std::move(key_)) {} | ||
| 15 | |||
| 16 | Input::MotionStatus GetStatus() const override { | ||
| 17 | |||
| 18 | if (key->GetStatus()) { | ||
| 19 | return motion.GetRandomMotion(2, 6); | ||
| 20 | } | ||
| 21 | return motion.GetRandomMotion(0, 0); | ||
| 22 | } | ||
| 23 | |||
| 24 | private: | ||
| 25 | Button key; | ||
| 26 | InputCommon::MotionInput motion{0.0f, 0.0f, 0.0f}; | ||
| 27 | }; | ||
| 28 | |||
| 29 | std::unique_ptr<Input::MotionDevice> MotionFromButton::Create(const Common::ParamPackage& params) { | ||
| 30 | auto key = Input::CreateDevice<Input::ButtonDevice>(params.Serialize()); | ||
| 31 | return std::make_unique<MotionKey>(std::move(key)); | ||
| 32 | } | ||
| 33 | |||
| 34 | } // namespace InputCommon | ||
diff --git a/src/input_common/motion_from_button.h b/src/input_common/motion_from_button.h deleted file mode 100644 index a959046fb..000000000 --- a/src/input_common/motion_from_button.h +++ /dev/null | |||
| @@ -1,25 +0,0 @@ | |||
| 1 | // Copyright 2020 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include "core/frontend/input.h" | ||
| 8 | |||
| 9 | namespace InputCommon { | ||
| 10 | |||
| 11 | /** | ||
| 12 | * An motion device factory that takes a keyboard button and uses it as a random | ||
| 13 | * motion device. | ||
| 14 | */ | ||
| 15 | class MotionFromButton final : public Input::Factory<Input::MotionDevice> { | ||
| 16 | public: | ||
| 17 | /** | ||
| 18 | * Creates an motion device from button devices | ||
| 19 | * @param params contains parameters for creating the device: | ||
| 20 | * - "key": a serialized ParamPackage for creating a button device | ||
| 21 | */ | ||
| 22 | std::unique_ptr<Input::MotionDevice> Create(const Common::ParamPackage& params) override; | ||
| 23 | }; | ||
| 24 | |||
| 25 | } // namespace InputCommon | ||
diff --git a/src/input_common/motion_input.cpp b/src/input_common/motion_input.cpp deleted file mode 100644 index 1c9d561c0..000000000 --- a/src/input_common/motion_input.cpp +++ /dev/null | |||
| @@ -1,307 +0,0 @@ | |||
| 1 | // Copyright 2020 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included | ||
| 4 | |||
| 5 | #include <random> | ||
| 6 | #include "common/math_util.h" | ||
| 7 | #include "input_common/motion_input.h" | ||
| 8 | |||
| 9 | namespace InputCommon { | ||
| 10 | |||
| 11 | MotionInput::MotionInput(f32 new_kp, f32 new_ki, f32 new_kd) : kp(new_kp), ki(new_ki), kd(new_kd) {} | ||
| 12 | |||
| 13 | void MotionInput::SetAcceleration(const Common::Vec3f& acceleration) { | ||
| 14 | accel = acceleration; | ||
| 15 | } | ||
| 16 | |||
| 17 | void MotionInput::SetGyroscope(const Common::Vec3f& gyroscope) { | ||
| 18 | gyro = gyroscope - gyro_drift; | ||
| 19 | |||
| 20 | // Auto adjust drift to minimize drift | ||
| 21 | if (!IsMoving(0.1f)) { | ||
| 22 | gyro_drift = (gyro_drift * 0.9999f) + (gyroscope * 0.0001f); | ||
| 23 | } | ||
| 24 | |||
| 25 | if (gyro.Length2() < gyro_threshold) { | ||
| 26 | gyro = {}; | ||
| 27 | } else { | ||
| 28 | only_accelerometer = false; | ||
| 29 | } | ||
| 30 | } | ||
| 31 | |||
| 32 | void MotionInput::SetQuaternion(const Common::Quaternion<f32>& quaternion) { | ||
| 33 | quat = quaternion; | ||
| 34 | } | ||
| 35 | |||
| 36 | void MotionInput::SetGyroDrift(const Common::Vec3f& drift) { | ||
| 37 | gyro_drift = drift; | ||
| 38 | } | ||
| 39 | |||
| 40 | void MotionInput::SetGyroThreshold(f32 threshold) { | ||
| 41 | gyro_threshold = threshold; | ||
| 42 | } | ||
| 43 | |||
| 44 | void MotionInput::EnableReset(bool reset) { | ||
| 45 | reset_enabled = reset; | ||
| 46 | } | ||
| 47 | |||
| 48 | void MotionInput::ResetRotations() { | ||
| 49 | rotations = {}; | ||
| 50 | } | ||
| 51 | |||
| 52 | bool MotionInput::IsMoving(f32 sensitivity) const { | ||
| 53 | return gyro.Length() >= sensitivity || accel.Length() <= 0.9f || accel.Length() >= 1.1f; | ||
| 54 | } | ||
| 55 | |||
| 56 | bool MotionInput::IsCalibrated(f32 sensitivity) const { | ||
| 57 | return real_error.Length() < sensitivity; | ||
| 58 | } | ||
| 59 | |||
| 60 | void MotionInput::UpdateRotation(u64 elapsed_time) { | ||
| 61 | const auto sample_period = static_cast<f32>(elapsed_time) / 1000000.0f; | ||
| 62 | if (sample_period > 0.1f) { | ||
| 63 | return; | ||
| 64 | } | ||
| 65 | rotations += gyro * sample_period; | ||
| 66 | } | ||
| 67 | |||
| 68 | void MotionInput::UpdateOrientation(u64 elapsed_time) { | ||
| 69 | if (!IsCalibrated(0.1f)) { | ||
| 70 | ResetOrientation(); | ||
| 71 | } | ||
| 72 | // Short name local variable for readability | ||
| 73 | f32 q1 = quat.w; | ||
| 74 | f32 q2 = quat.xyz[0]; | ||
| 75 | f32 q3 = quat.xyz[1]; | ||
| 76 | f32 q4 = quat.xyz[2]; | ||
| 77 | const auto sample_period = static_cast<f32>(elapsed_time) / 1000000.0f; | ||
| 78 | |||
| 79 | // Ignore invalid elapsed time | ||
| 80 | if (sample_period > 0.1f) { | ||
| 81 | return; | ||
| 82 | } | ||
| 83 | |||
| 84 | const auto normal_accel = accel.Normalized(); | ||
| 85 | auto rad_gyro = gyro * Common::PI * 2; | ||
| 86 | const f32 swap = rad_gyro.x; | ||
| 87 | rad_gyro.x = rad_gyro.y; | ||
| 88 | rad_gyro.y = -swap; | ||
| 89 | rad_gyro.z = -rad_gyro.z; | ||
| 90 | |||
| 91 | // Clear gyro values if there is no gyro present | ||
| 92 | if (only_accelerometer) { | ||
| 93 | rad_gyro.x = 0; | ||
| 94 | rad_gyro.y = 0; | ||
| 95 | rad_gyro.z = 0; | ||
| 96 | } | ||
| 97 | |||
| 98 | // Ignore drift correction if acceleration is not reliable | ||
| 99 | if (accel.Length() >= 0.75f && accel.Length() <= 1.25f) { | ||
| 100 | const f32 ax = -normal_accel.x; | ||
| 101 | const f32 ay = normal_accel.y; | ||
| 102 | const f32 az = -normal_accel.z; | ||
| 103 | |||
| 104 | // Estimated direction of gravity | ||
| 105 | const f32 vx = 2.0f * (q2 * q4 - q1 * q3); | ||
| 106 | const f32 vy = 2.0f * (q1 * q2 + q3 * q4); | ||
| 107 | const f32 vz = q1 * q1 - q2 * q2 - q3 * q3 + q4 * q4; | ||
| 108 | |||
| 109 | // Error is cross product between estimated direction and measured direction of gravity | ||
| 110 | const Common::Vec3f new_real_error = { | ||
| 111 | az * vx - ax * vz, | ||
| 112 | ay * vz - az * vy, | ||
| 113 | ax * vy - ay * vx, | ||
| 114 | }; | ||
| 115 | |||
| 116 | derivative_error = new_real_error - real_error; | ||
| 117 | real_error = new_real_error; | ||
| 118 | |||
| 119 | // Prevent integral windup | ||
| 120 | if (ki != 0.0f && !IsCalibrated(0.05f)) { | ||
| 121 | integral_error += real_error; | ||
| 122 | } else { | ||
| 123 | integral_error = {}; | ||
| 124 | } | ||
| 125 | |||
| 126 | // Apply feedback terms | ||
| 127 | if (!only_accelerometer) { | ||
| 128 | rad_gyro += kp * real_error; | ||
| 129 | rad_gyro += ki * integral_error; | ||
| 130 | rad_gyro += kd * derivative_error; | ||
| 131 | } else { | ||
| 132 | // Give more weight to accelerometer values to compensate for the lack of gyro | ||
| 133 | rad_gyro += 35.0f * kp * real_error; | ||
| 134 | rad_gyro += 10.0f * ki * integral_error; | ||
| 135 | rad_gyro += 10.0f * kd * derivative_error; | ||
| 136 | |||
| 137 | // Emulate gyro values for games that need them | ||
| 138 | gyro.x = -rad_gyro.y; | ||
| 139 | gyro.y = rad_gyro.x; | ||
| 140 | gyro.z = -rad_gyro.z; | ||
| 141 | UpdateRotation(elapsed_time); | ||
| 142 | } | ||
| 143 | } | ||
| 144 | |||
| 145 | const f32 gx = rad_gyro.y; | ||
| 146 | const f32 gy = rad_gyro.x; | ||
| 147 | const f32 gz = rad_gyro.z; | ||
| 148 | |||
| 149 | // Integrate rate of change of quaternion | ||
| 150 | const f32 pa = q2; | ||
| 151 | const f32 pb = q3; | ||
| 152 | const f32 pc = q4; | ||
| 153 | q1 = q1 + (-q2 * gx - q3 * gy - q4 * gz) * (0.5f * sample_period); | ||
| 154 | q2 = pa + (q1 * gx + pb * gz - pc * gy) * (0.5f * sample_period); | ||
| 155 | q3 = pb + (q1 * gy - pa * gz + pc * gx) * (0.5f * sample_period); | ||
| 156 | q4 = pc + (q1 * gz + pa * gy - pb * gx) * (0.5f * sample_period); | ||
| 157 | |||
| 158 | quat.w = q1; | ||
| 159 | quat.xyz[0] = q2; | ||
| 160 | quat.xyz[1] = q3; | ||
| 161 | quat.xyz[2] = q4; | ||
| 162 | quat = quat.Normalized(); | ||
| 163 | } | ||
| 164 | |||
| 165 | std::array<Common::Vec3f, 3> MotionInput::GetOrientation() const { | ||
| 166 | const Common::Quaternion<float> quad{ | ||
| 167 | .xyz = {-quat.xyz[1], -quat.xyz[0], -quat.w}, | ||
| 168 | .w = -quat.xyz[2], | ||
| 169 | }; | ||
| 170 | const std::array<float, 16> matrix4x4 = quad.ToMatrix(); | ||
| 171 | |||
| 172 | return {Common::Vec3f(matrix4x4[0], matrix4x4[1], -matrix4x4[2]), | ||
| 173 | Common::Vec3f(matrix4x4[4], matrix4x4[5], -matrix4x4[6]), | ||
| 174 | Common::Vec3f(-matrix4x4[8], -matrix4x4[9], matrix4x4[10])}; | ||
| 175 | } | ||
| 176 | |||
| 177 | Common::Vec3f MotionInput::GetAcceleration() const { | ||
| 178 | return accel; | ||
| 179 | } | ||
| 180 | |||
| 181 | Common::Vec3f MotionInput::GetGyroscope() const { | ||
| 182 | return gyro; | ||
| 183 | } | ||
| 184 | |||
| 185 | Common::Quaternion<f32> MotionInput::GetQuaternion() const { | ||
| 186 | return quat; | ||
| 187 | } | ||
| 188 | |||
| 189 | Common::Vec3f MotionInput::GetRotations() const { | ||
| 190 | return rotations; | ||
| 191 | } | ||
| 192 | |||
| 193 | Input::MotionStatus MotionInput::GetMotion() const { | ||
| 194 | const Common::Vec3f gyroscope = GetGyroscope(); | ||
| 195 | const Common::Vec3f accelerometer = GetAcceleration(); | ||
| 196 | const Common::Vec3f rotation = GetRotations(); | ||
| 197 | const std::array<Common::Vec3f, 3> orientation = GetOrientation(); | ||
| 198 | const Common::Quaternion<f32> quaternion = GetQuaternion(); | ||
| 199 | return {accelerometer, gyroscope, rotation, orientation, quaternion}; | ||
| 200 | } | ||
| 201 | |||
| 202 | Input::MotionStatus MotionInput::GetRandomMotion(int accel_magnitude, int gyro_magnitude) const { | ||
| 203 | std::random_device device; | ||
| 204 | std::mt19937 gen(device()); | ||
| 205 | std::uniform_int_distribution<s16> distribution(-1000, 1000); | ||
| 206 | const Common::Vec3f gyroscope{ | ||
| 207 | static_cast<f32>(distribution(gen)) * 0.001f, | ||
| 208 | static_cast<f32>(distribution(gen)) * 0.001f, | ||
| 209 | static_cast<f32>(distribution(gen)) * 0.001f, | ||
| 210 | }; | ||
| 211 | const Common::Vec3f accelerometer{ | ||
| 212 | static_cast<f32>(distribution(gen)) * 0.001f, | ||
| 213 | static_cast<f32>(distribution(gen)) * 0.001f, | ||
| 214 | static_cast<f32>(distribution(gen)) * 0.001f, | ||
| 215 | }; | ||
| 216 | constexpr Common::Vec3f rotation; | ||
| 217 | constexpr std::array orientation{ | ||
| 218 | Common::Vec3f{1.0f, 0.0f, 0.0f}, | ||
| 219 | Common::Vec3f{0.0f, 1.0f, 0.0f}, | ||
| 220 | Common::Vec3f{0.0f, 0.0f, 1.0f}, | ||
| 221 | }; | ||
| 222 | constexpr Common::Quaternion<f32> quaternion{ | ||
| 223 | {0.0f, 0.0f, 0.0f}, | ||
| 224 | 1.0f, | ||
| 225 | }; | ||
| 226 | return {accelerometer * accel_magnitude, gyroscope * gyro_magnitude, rotation, orientation, | ||
| 227 | quaternion}; | ||
| 228 | } | ||
| 229 | |||
| 230 | void MotionInput::ResetOrientation() { | ||
| 231 | if (!reset_enabled || only_accelerometer) { | ||
| 232 | return; | ||
| 233 | } | ||
| 234 | if (!IsMoving(0.5f) && accel.z <= -0.9f) { | ||
| 235 | ++reset_counter; | ||
| 236 | if (reset_counter > 900) { | ||
| 237 | quat.w = 0; | ||
| 238 | quat.xyz[0] = 0; | ||
| 239 | quat.xyz[1] = 0; | ||
| 240 | quat.xyz[2] = -1; | ||
| 241 | SetOrientationFromAccelerometer(); | ||
| 242 | integral_error = {}; | ||
| 243 | reset_counter = 0; | ||
| 244 | } | ||
| 245 | } else { | ||
| 246 | reset_counter = 0; | ||
| 247 | } | ||
| 248 | } | ||
| 249 | |||
| 250 | void MotionInput::SetOrientationFromAccelerometer() { | ||
| 251 | int iterations = 0; | ||
| 252 | const f32 sample_period = 0.015f; | ||
| 253 | |||
| 254 | const auto normal_accel = accel.Normalized(); | ||
| 255 | |||
| 256 | while (!IsCalibrated(0.01f) && ++iterations < 100) { | ||
| 257 | // Short name local variable for readability | ||
| 258 | f32 q1 = quat.w; | ||
| 259 | f32 q2 = quat.xyz[0]; | ||
| 260 | f32 q3 = quat.xyz[1]; | ||
| 261 | f32 q4 = quat.xyz[2]; | ||
| 262 | |||
| 263 | Common::Vec3f rad_gyro; | ||
| 264 | const f32 ax = -normal_accel.x; | ||
| 265 | const f32 ay = normal_accel.y; | ||
| 266 | const f32 az = -normal_accel.z; | ||
| 267 | |||
| 268 | // Estimated direction of gravity | ||
| 269 | const f32 vx = 2.0f * (q2 * q4 - q1 * q3); | ||
| 270 | const f32 vy = 2.0f * (q1 * q2 + q3 * q4); | ||
| 271 | const f32 vz = q1 * q1 - q2 * q2 - q3 * q3 + q4 * q4; | ||
| 272 | |||
| 273 | // Error is cross product between estimated direction and measured direction of gravity | ||
| 274 | const Common::Vec3f new_real_error = { | ||
| 275 | az * vx - ax * vz, | ||
| 276 | ay * vz - az * vy, | ||
| 277 | ax * vy - ay * vx, | ||
| 278 | }; | ||
| 279 | |||
| 280 | derivative_error = new_real_error - real_error; | ||
| 281 | real_error = new_real_error; | ||
| 282 | |||
| 283 | rad_gyro += 10.0f * kp * real_error; | ||
| 284 | rad_gyro += 5.0f * ki * integral_error; | ||
| 285 | rad_gyro += 10.0f * kd * derivative_error; | ||
| 286 | |||
| 287 | const f32 gx = rad_gyro.y; | ||
| 288 | const f32 gy = rad_gyro.x; | ||
| 289 | const f32 gz = rad_gyro.z; | ||
| 290 | |||
| 291 | // Integrate rate of change of quaternion | ||
| 292 | const f32 pa = q2; | ||
| 293 | const f32 pb = q3; | ||
| 294 | const f32 pc = q4; | ||
| 295 | q1 = q1 + (-q2 * gx - q3 * gy - q4 * gz) * (0.5f * sample_period); | ||
| 296 | q2 = pa + (q1 * gx + pb * gz - pc * gy) * (0.5f * sample_period); | ||
| 297 | q3 = pb + (q1 * gy - pa * gz + pc * gx) * (0.5f * sample_period); | ||
| 298 | q4 = pc + (q1 * gz + pa * gy - pb * gx) * (0.5f * sample_period); | ||
| 299 | |||
| 300 | quat.w = q1; | ||
| 301 | quat.xyz[0] = q2; | ||
| 302 | quat.xyz[1] = q3; | ||
| 303 | quat.xyz[2] = q4; | ||
| 304 | quat = quat.Normalized(); | ||
| 305 | } | ||
| 306 | } | ||
| 307 | } // namespace InputCommon | ||
diff --git a/src/input_common/motion_input.h b/src/input_common/motion_input.h deleted file mode 100644 index efe74cf19..000000000 --- a/src/input_common/motion_input.h +++ /dev/null | |||
| @@ -1,74 +0,0 @@ | |||
| 1 | // Copyright 2020 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include "common/common_types.h" | ||
| 8 | #include "common/quaternion.h" | ||
| 9 | #include "common/vector_math.h" | ||
| 10 | #include "core/frontend/input.h" | ||
| 11 | |||
| 12 | namespace InputCommon { | ||
| 13 | |||
| 14 | class MotionInput { | ||
| 15 | public: | ||
| 16 | explicit MotionInput(f32 new_kp, f32 new_ki, f32 new_kd); | ||
| 17 | |||
| 18 | MotionInput(const MotionInput&) = default; | ||
| 19 | MotionInput& operator=(const MotionInput&) = default; | ||
| 20 | |||
| 21 | MotionInput(MotionInput&&) = default; | ||
| 22 | MotionInput& operator=(MotionInput&&) = default; | ||
| 23 | |||
| 24 | void SetAcceleration(const Common::Vec3f& acceleration); | ||
| 25 | void SetGyroscope(const Common::Vec3f& gyroscope); | ||
| 26 | void SetQuaternion(const Common::Quaternion<f32>& quaternion); | ||
| 27 | void SetGyroDrift(const Common::Vec3f& drift); | ||
| 28 | void SetGyroThreshold(f32 threshold); | ||
| 29 | |||
| 30 | void EnableReset(bool reset); | ||
| 31 | void ResetRotations(); | ||
| 32 | |||
| 33 | void UpdateRotation(u64 elapsed_time); | ||
| 34 | void UpdateOrientation(u64 elapsed_time); | ||
| 35 | |||
| 36 | [[nodiscard]] std::array<Common::Vec3f, 3> GetOrientation() const; | ||
| 37 | [[nodiscard]] Common::Vec3f GetAcceleration() const; | ||
| 38 | [[nodiscard]] Common::Vec3f GetGyroscope() const; | ||
| 39 | [[nodiscard]] Common::Vec3f GetRotations() const; | ||
| 40 | [[nodiscard]] Common::Quaternion<f32> GetQuaternion() const; | ||
| 41 | [[nodiscard]] Input::MotionStatus GetMotion() const; | ||
| 42 | [[nodiscard]] Input::MotionStatus GetRandomMotion(int accel_magnitude, | ||
| 43 | int gyro_magnitude) const; | ||
| 44 | |||
| 45 | [[nodiscard]] bool IsMoving(f32 sensitivity) const; | ||
| 46 | [[nodiscard]] bool IsCalibrated(f32 sensitivity) const; | ||
| 47 | |||
| 48 | private: | ||
| 49 | void ResetOrientation(); | ||
| 50 | void SetOrientationFromAccelerometer(); | ||
| 51 | |||
| 52 | // PID constants | ||
| 53 | f32 kp; | ||
| 54 | f32 ki; | ||
| 55 | f32 kd; | ||
| 56 | |||
| 57 | // PID errors | ||
| 58 | Common::Vec3f real_error; | ||
| 59 | Common::Vec3f integral_error; | ||
| 60 | Common::Vec3f derivative_error; | ||
| 61 | |||
| 62 | Common::Quaternion<f32> quat{{0.0f, 0.0f, -1.0f}, 0.0f}; | ||
| 63 | Common::Vec3f rotations; | ||
| 64 | Common::Vec3f accel; | ||
| 65 | Common::Vec3f gyro; | ||
| 66 | Common::Vec3f gyro_drift; | ||
| 67 | |||
| 68 | f32 gyro_threshold = 0.0f; | ||
| 69 | u32 reset_counter = 0; | ||
| 70 | bool reset_enabled = true; | ||
| 71 | bool only_accelerometer = true; | ||
| 72 | }; | ||
| 73 | |||
| 74 | } // namespace InputCommon | ||