Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.5] Input -> "Get Controller [Motion Sensor]" and "Set Controller [Motion Sensor]" function for GDScript #21

Open
1 of 2 tasks
halotroop2288 opened this issue Jan 24, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@halotroop2288
Copy link
Member

Vector3 get_joy_gravity(int p_device);
Vector3 get_joy_accelerometer(int p_device);
Vector3 get_joy_magnetometer(int p_device);
Vector3 get_joy_gyroscope(int p_device);


Vector3 set_joy_gravity(int p_device, const Vector3 &p_gravity);
Vector3 set_joy_accelerometer(int p_device, const Vector3 &p_accel);
Vector3 set_joy_magnetometer(int p_device, const Vector3 &p_magnetometer);
Vector3 set_joy_gyroscope(int p_device, const Vector3 &p_gyroscope);
  • By default, these functions should return the same as the "Get [Motion Sensor]" functions that already exist.
  • For platforms that support multiple devices with motion sensors (such as PS3, PS4, PS5, and Switch), These functions should return the motion data provided by the individual controller.

Progress

  • Fallback implementation
  • Switch implementation
@halotroop2288 halotroop2288 self-assigned this Jan 24, 2024
@halotroop2288 halotroop2288 added the enhancement New feature or request label Jan 24, 2024
@halotroop2288 halotroop2288 changed the title Input -> "Get Controller [Motion Sensor]" and "Set Controller [Motion Sensor]" function for GDScript [3.5 | Switch] Input -> "Get Controller [Motion Sensor]" and "Set Controller [Motion Sensor]" function for GDScript Jan 24, 2024
@halotroop2288 halotroop2288 removed their assignment Nov 3, 2024
@halotroop2288 halotroop2288 transferred this issue from Homebrodot/Godot Nov 10, 2024
@halotroop2288 halotroop2288 transferred this issue from Homebrodot/platform-switch Nov 10, 2024
@halotroop2288 halotroop2288 changed the title [3.5 | Switch] Input -> "Get Controller [Motion Sensor]" and "Set Controller [Motion Sensor]" function for GDScript [3.5] Input -> "Get Controller [Motion Sensor]" and "Set Controller [Motion Sensor]" function for GDScript Nov 10, 2024
@halotroop2288
Copy link
Member Author

halotroop2288 commented Nov 10, 2024

By default, these functions should return the same as the "Get [Motion Sensor]" functions that already exist.

Actually I'd like to amend this to just return zero for everything except pad index 0, the emulated gamepad. Because on PC, these will always return zero until they're implemented for controllers. And on mobile, external controllers should not reflect the state of the mobile sensors.

@technicaljicama
Copy link
Member

I believe this is implemented in the vita port

@halotroop2288
Copy link
Member Author

halotroop2288 commented Nov 25, 2024

The Vita does not support multiple controllers. And these functions do not exist in the upstream, so I know they're not implemented in any existing ports.

Currently, the Vita will simply use the value returned by the device motion sensor in my implementation. The same as every other platform.
Though as I mentioned above, I'd like to change it to return zero so all the controllers don't accidentally move at the same time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In Progress
Development

No branches or pull requests

2 participants