Helion-Engine / Helion

A modern fast paced Doom FPS engine
GNU General Public License v3.0
134 stars 11 forks source link

[Post 0.9.5.X] Implement gyro and optionally flick stick #806

Closed JustinWayland closed 1 day ago

JustinWayland commented 1 month ago

This is going to be hard, mostly because GLFW currently does not, and probably never will, report output from the gyrometer if a controller has one. There are two things we might be able to do:

  1. I didn't look through it too deeply and it says that it doesn't have everything, but this binding might allow us to use SDL for input, which does have support for reporting the outputs from the gyrometer.
  2. OpenTK 5.0 apparently added SDL back in as a platform. Maybe we can see if OpenTK will pass gyrometer values to us.

This is definitely not going to be as easy to add as it was for Woof!, and should definitely be saved until after 0.9.5.0's release.

lemming104 commented 1 month ago

We've actually had good luck programmatically generating bindings for native libraries so long as the headers are available; they just aren't always nice to use.

What controller types have gyros?

JustinWayland commented 1 month ago

Mainly PlayStation and Nintendo Switch controllers. I have an 8bitdo Ultimate that masquerades as the latter when connected wirelessly, so I can test both if need be.

Xbox controllers don't have gyro.

SladeWilson52 commented 1 month ago

This would also be useful for players running this port on Steam Deck or other such handheld PCs.

JustinWayland commented 1 month ago

This might be useful if we end up needing to more closely integrate with SDL to get gyro readings.

JustinWayland commented 3 weeks ago

Just clarifying this feature as something that should be done once all the bugfixing from the 0.9.5.0 release settles down.

lemming104 commented 1 day ago

Gyro aiming implemented by https://github.com/Helion-Engine/Helion/pull/880; tested on Windows with DualShock 4 controller; haven't tested on Linux yet. No "flick stick" turn support at the moment; maybe later.