summaryrefslogtreecommitdiffstats
path: root/src/input_common
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-04-30 07:06:57 +0200
committerGitHub <noreply@github.com>2021-04-30 07:06:57 +0200
commit922b0d9933951a97879707e038f24f0ba2b3ef95 (patch)
tree0dee932da2a54352f20958a5357c6a7915e143a8 /src/input_common
parentMerge pull request #6258 from Morph1984/config-conv (diff)
parentaddress comments (diff)
downloadyuzu-922b0d9933951a97879707e038f24f0ba2b3ef95.tar
yuzu-922b0d9933951a97879707e038f24f0ba2b3ef95.tar.gz
yuzu-922b0d9933951a97879707e038f24f0ba2b3ef95.tar.bz2
yuzu-922b0d9933951a97879707e038f24f0ba2b3ef95.tar.lz
yuzu-922b0d9933951a97879707e038f24f0ba2b3ef95.tar.xz
yuzu-922b0d9933951a97879707e038f24f0ba2b3ef95.tar.zst
yuzu-922b0d9933951a97879707e038f24f0ba2b3ef95.zip
Diffstat (limited to 'src/input_common')
-rw-r--r--src/input_common/motion_input.cpp10
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 {
const Common::Vec3f accelerometer = GetAcceleration();
const Common::Vec3f rotation = GetRotations();
const std::array<Common::Vec3f, 3> orientation = GetOrientation();
- return {accelerometer, gyroscope, rotation, orientation};
+ const Common::Quaternion<f32> quaternion = GetQuaternion();
+ return {accelerometer, gyroscope, rotation, orientation, quaternion};
}
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
Common::Vec3f{0.0f, 1.0f, 0.0f},
Common::Vec3f{0.0f, 0.0f, 1.0f},
};
- return {accelerometer * accel_magnitude, gyroscope * gyro_magnitude, rotation, orientation};
+ constexpr Common::Quaternion<f32> quaternion{
+ {0.0f, 0.0f, 0.0f},
+ 1.0f,
+ };
+ return {accelerometer * accel_magnitude, gyroscope * gyro_magnitude, rotation, orientation,
+ quaternion};
}
void MotionInput::ResetOrientation() {