-
-
Notifications
You must be signed in to change notification settings - Fork 105
Description
Describe the project you are working on
Non-VR Motion-Control-centric First Person Shooter.
Describe the problem or limitation you are having in your project
Godot does not support reading motion sensor output from non-mobile devices. (Android/iOS)
Describe the feature / enhancement and how it helps to overcome the problem or limitation
We would aim to extend godot's current Input format, either via core, or a module,
Adding Motion Controls: gyroscopes; accelerometers, as Vector3 in GDScript, and a separate class within the Input system, would be a natural way to handle this.
However, a more generic implementation would be to make available the individual motion sensors as axes within godot's existing axis system. These can later be combined into a Vector3, but will be available and function identically to an axis.
The developer having access to these hardware inputs via GDScript would make implementing motion controls natural.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
One way to do this is through binding an external library, such as JoyShockLibrary or the Input sections of Simple DirectMedia Layer, which has supported the same featureset as JSL since 2.0.14.
Alternatively, extending the godot core by replicating the features of those libraries natively is plausible.
Additional functions for managing these inputs, such as calibration, and 3D math, can be important, which can be managed by a module based around GamepadMotionHelper.
The Ideal scenario is one where a developer can simply handle the motion controls the same way as they would any axis, having both the actions system and direct access available to them, like this:
var p1_gyro = Vector3(get_joy_axis(Gyro_X), get_joy_axis(Gyro_Y), get_joy_axis(Gyro_Z)) or
var p1_gyro = Vector3(get_joy_gyroX, get_joy_gyroY, get_joy_gyroZ)
the Gyro_ structs or get_joy_gyro function might be just a binding for something like float JslGetGyroX/JslGetGyroY/JslGetGyroZ(int deviceId) from JSL, but it should function similarly.
If this enhancement will not be used often, can it be worked around with a few lines of script?
This enhancement cannot be achieved without changes to godot.
Is there a reason why this should be core and not an add-on in the asset library?
Matters dealing with hardware may be best implemented at core level.
I'm personally willing to work on developing this feature myself, but it's been a few years since I've programmed anything, and I'm not sure whether core changes or modules are the better way to go about this.
I imagine a combination of both has the most longevity. Separating GMH into a module is definitely more reasonable. However, one might argue that the entire gyro functionality might be superfluous for many users and should be modular.
I'm making this proposal mostly to gauge support and get some advice from godot developers on what to do first, before I start doing something completely wrong. Mainly whether module or core should be the focus.
Thanks for reading this far, and also thanks to JibbSmart for making so many tools for motion control development.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status