Fix accelerometer axis to have correct data for orientation (#563)

This commit is contained in:
german77 2020-10-06 06:33:09 -05:00 committed by GitHub
parent 36346c1896
commit f9f1ea4081
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}
}
}