diff options
Diffstat (limited to 'src/input_common/motion_input.cpp')
| -rw-r--r-- | src/input_common/motion_input.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/input_common/motion_input.cpp b/src/input_common/motion_input.cpp index 6a65f175e..1c9d561c0 100644 --- a/src/input_common/motion_input.cpp +++ b/src/input_common/motion_input.cpp | |||
| @@ -195,7 +195,8 @@ Input::MotionStatus MotionInput::GetMotion() const { | |||
| 195 | const Common::Vec3f accelerometer = GetAcceleration(); | 195 | const Common::Vec3f accelerometer = GetAcceleration(); |
| 196 | const Common::Vec3f rotation = GetRotations(); | 196 | const Common::Vec3f rotation = GetRotations(); |
| 197 | const std::array<Common::Vec3f, 3> orientation = GetOrientation(); | 197 | const std::array<Common::Vec3f, 3> orientation = GetOrientation(); |
| 198 | return {accelerometer, gyroscope, rotation, orientation}; | 198 | const Common::Quaternion<f32> quaternion = GetQuaternion(); |
| 199 | return {accelerometer, gyroscope, rotation, orientation, quaternion}; | ||
| 199 | } | 200 | } |
| 200 | 201 | ||
| 201 | Input::MotionStatus MotionInput::GetRandomMotion(int accel_magnitude, int gyro_magnitude) const { | 202 | Input::MotionStatus MotionInput::GetRandomMotion(int accel_magnitude, int gyro_magnitude) const { |
| @@ -218,7 +219,12 @@ Input::MotionStatus MotionInput::GetRandomMotion(int accel_magnitude, int gyro_m | |||
| 218 | Common::Vec3f{0.0f, 1.0f, 0.0f}, | 219 | Common::Vec3f{0.0f, 1.0f, 0.0f}, |
| 219 | Common::Vec3f{0.0f, 0.0f, 1.0f}, | 220 | Common::Vec3f{0.0f, 0.0f, 1.0f}, |
| 220 | }; | 221 | }; |
| 221 | return {accelerometer * accel_magnitude, gyroscope * gyro_magnitude, rotation, orientation}; | 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}; | ||
| 222 | } | 228 | } |
| 223 | 229 | ||
| 224 | void MotionInput::ResetOrientation() { | 230 | void MotionInput::ResetOrientation() { |