r57zone / DualShock4-emulator

DualShock4 emulation for Xbox controllers or keyboard and mouse / Эмуляция DualShock4 для Xbox контроллеров или клавиатуры и мыши
https://youtu.be/17hY1zTqoYQ
The Unlicense
189 stars 30 forks source link

Motion Orientation #56

Closed the-maazu closed 2 years ago

the-maazu commented 2 years ago

closes #55

Tried all 6 combinations of axis arrangements.

Also it seems rotation direction for controller X and Z axis is opposite of phone. Recommend InverseX and InverseZ under Motion be set 1 in packaged config.ini.

r57zone commented 2 years ago

Hi, thanks for the PR.

r57zone commented 2 years ago

I updated the version, could you check if everything is correct? What game are you testing the gyroscope in? Does it work well? Thanks. https://github.com/r57zone/DualShock4-emulator/releases

the-maazu commented 2 years ago

gyro has never worked for me in game (Detroit Become Human and Days Gone). was trying to figure out why when I realised from VSCView the orientation was off. Its a step towards the right direction.

Few issues I have:

  1. freePIE outputs accel gyro values in m/s^2 and rad/s but controller outputs signed short which we do not know the relation to m/s^2 and rad/s. If we know the maximum m/s^s and rad/s for the controller we can proportional set the short value. DS4 motion sensor chip
  2. The unknown 5 bytes after gyro and accel in report might be related to orientation data or other things some games might be using.
  3. Timestamp in report is also used by some games with accel and gyro data for motion. Typical increment is 188 from Data Format. At full rate 1.25ms if I understand this correctly then 188 is nanoseconds, but sleeptime is only possible in milliseconds in windows.
the-maazu commented 2 years ago

Just got it working for motion aim in days gone with the time stamp, although sensitivity is quite low. Will send a PR soon

Samwilsonn commented 3 months ago

hey maazu... Can you please tell me how you made the gamepad rotation work in detroit become human,,, i am pressing the numpad keys but nothing is working

r57zone commented 3 months ago

@Samwilsonn, If you have an Android smartphone with a gyroscope, you can try this https://github.com/r57zone/DualShock4-emulator#motion-with-android-phone-gyroscope , otherwise disable motion in the game settings.