From f9f1ea40816d11889cc38bd5a7c073b7960f3982 Mon Sep 17 00:00:00 2001 From: german77 Date: Tue, 6 Oct 2020 06:33:09 -0500 Subject: [PATCH] Fix accelerometer axis to have correct data for orientation (#563) --- BetterJoyForCemu/Joycon.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/BetterJoyForCemu/Joycon.cs b/BetterJoyForCemu/Joycon.cs index 222aec7..69b914e 100644 --- a/BetterJoyForCemu/Joycon.cs +++ b/BetterJoyForCemu/Joycon.cs @@ -1005,13 +1005,19 @@ namespace BetterJoyForCemu { if (other == null && !isPro) { // single joycon mode; Z do not swap, rest do if (isLeft) { acc_g.X = -acc_g.X; + acc_g.Y = -acc_g.Y; gyr_g.X = -gyr_g.X; } else { gyr_g.Y = -gyr_g.Y; } - float temp = acc_g.X; acc_g.X = acc_g.Y; acc_g.Y = temp; - temp = gyr_g.X; gyr_g.X = gyr_g.Y; gyr_g.Y = temp; + float temp = acc_g.X; + acc_g.X = acc_g.Y; + acc_g.Y = -temp; + + temp = gyr_g.X; + gyr_g.X = gyr_g.Y; + gyr_g.Y = temp; } } }