Fix accelerometer axis to have correct data for orientation (#563)
This commit is contained in:
parent
36346c1896
commit
f9f1ea4081
1 changed files with 8 additions and 2 deletions
|
@ -1005,13 +1005,19 @@ namespace BetterJoyForCemu {
|
||||||
if (other == null && !isPro) { // single joycon mode; Z do not swap, rest do
|
if (other == null && !isPro) { // single joycon mode; Z do not swap, rest do
|
||||||
if (isLeft) {
|
if (isLeft) {
|
||||||
acc_g.X = -acc_g.X;
|
acc_g.X = -acc_g.X;
|
||||||
|
acc_g.Y = -acc_g.Y;
|
||||||
gyr_g.X = -gyr_g.X;
|
gyr_g.X = -gyr_g.X;
|
||||||
} else {
|
} else {
|
||||||
gyr_g.Y = -gyr_g.Y;
|
gyr_g.Y = -gyr_g.Y;
|
||||||
}
|
}
|
||||||
|
|
||||||
float temp = acc_g.X; acc_g.X = acc_g.Y; acc_g.Y = temp;
|
float temp = acc_g.X;
|
||||||
temp = gyr_g.X; gyr_g.X = gyr_g.Y; gyr_g.Y = temp;
|
acc_g.X = acc_g.Y;
|
||||||
|
acc_g.Y = -temp;
|
||||||
|
|
||||||
|
temp = gyr_g.X;
|
||||||
|
gyr_g.X = gyr_g.Y;
|
||||||
|
gyr_g.Y = temp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue