1
0
Fork 0

Correct direction vectors for cemuhook motion input

This commit is contained in:
James Rowe 2018-08-07 10:01:09 -06:00
parent 6bcbda5ab2
commit 169bb29a54
1 changed files with 5 additions and 2 deletions

View File

@ -157,8 +157,11 @@ void Client::OnPadData(Response::PadData data) {
return;
}
packet_sequence = data.packet_counter;
Math::Vec3f accel = Math::MakeVec<float>(data.accel.x, data.accel.y, data.accel.z);
Math::Vec3f gyro = Math::MakeVec<float>(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<float>(-data.accel.x, data.accel.y, -data.accel.z);
Math::Vec3f gyro = Math::MakeVec<float>(-data.gyro.pitch, -data.gyro.yaw, data.gyro.roll);
{
std::lock_guard<std::mutex> guard(status->update_mutex);