From 169bb29a54190a373c7447e0b277e9a894be078a Mon Sep 17 00:00:00 2001 From: James Rowe Date: Tue, 7 Aug 2018 10:01:09 -0600 Subject: [PATCH] Correct direction vectors for cemuhook motion input --- src/input_common/udp/client.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/input_common/udp/client.cpp b/src/input_common/udp/client.cpp index 40eed14c4..a5343384c 100644 --- a/src/input_common/udp/client.cpp +++ b/src/input_common/udp/client.cpp @@ -157,8 +157,11 @@ void Client::OnPadData(Response::PadData data) { return; } packet_sequence = data.packet_counter; - Math::Vec3f accel = Math::MakeVec(data.accel.x, data.accel.y, data.accel.z); - Math::Vec3f gyro = Math::MakeVec(data.gyro.pitch, data.gyro.yaw, data.gyro.roll); + // Due to differences between the 3ds and cemuhookudp motion directions, we need to invert + // accel.x and accel.z and also invert pitch and yaw. See + // https://github.com/citra-emu/citra/pull/4049 for more details on gyro/accel + Math::Vec3f accel = Math::MakeVec(-data.accel.x, data.accel.y, -data.accel.z); + Math::Vec3f gyro = Math::MakeVec(-data.gyro.pitch, -data.gyro.yaw, data.gyro.roll); { std::lock_guard guard(status->update_mutex);