godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.15k stars 97 forks source link

Add a function to get the controller orientation info. #7342

Closed RadiantUwU closed 1 year ago

RadiantUwU commented 1 year ago

Describe the project you are working on

A VR test area for mobile users.

Describe the problem or limitation you are having in your project

Being unable to get the connected controller's orientation to be used in menus.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

This feature would allow me to build up menus using the controller's orientation to project a ray on the screen and show what the player would be pointing at.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Input.get_joypad_gyroscope(device: int) -> Vector3

returns Vector3.ZERO if the device does not have a gyroscope sensor.

If this enhancement will not be used often, can it be worked around with a few lines of script?

No.

Is there a reason why this should be core and not an add-on in the asset library?

This should be core so not only VR games use this, but also othet games for things such as racing, steering a car for example is another use case for the controller's gyroscope.

Calinou commented 1 year ago

Thanks for the proposal! Consolidating in https://github.com/godotengine/godot-proposals/issues/2829.