summaryrefslogtreecommitdiffstats
path: root/src/input_common
diff options
context:
space:
mode:
authorgerman77 <juangerman-13@hotmail.com>2021-04-22 20:15:59 +0200
committergerman77 <juangerman-13@hotmail.com>2021-04-24 05:12:41 +0200
commitc19ad21ae855c9143a871e378e8d8c59abcaebfa (patch)
tree90499012c2bcac1620ca69e4ef6b10edb5ffe009 /src/input_common
parentMerge pull request #6224 from Morph1984/hid_InitializeSevenSixAxisSensor (diff)
downloadyuzu-c19ad21ae855c9143a871e378e8d8c59abcaebfa.tar
yuzu-c19ad21ae855c9143a871e378e8d8c59abcaebfa.tar.gz
yuzu-c19ad21ae855c9143a871e378e8d8c59abcaebfa.tar.bz2
yuzu-c19ad21ae855c9143a871e378e8d8c59abcaebfa.tar.lz
yuzu-c19ad21ae855c9143a871e378e8d8c59abcaebfa.tar.xz
yuzu-c19ad21ae855c9143a871e378e8d8c59abcaebfa.tar.zst
yuzu-c19ad21ae855c9143a871e378e8d8c59abcaebfa.zip
Diffstat (limited to '')
-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() {