mirror of
https://github.com/bevyengine/bevy
synced 2024-12-12 14:22:28 +00:00
a1e442cd2a
# Objective Provide the ability to trigger controller rumbling (force-feedback) with a cross-platform API. ## Solution This adds the `GamepadRumbleRequest` event to `bevy_input` and adds a system in `bevy_gilrs` to read them and rumble controllers accordingly. It's a relatively primitive API with a `duration` in seconds and `GamepadRumbleIntensity` with values for the weak and strong gamepad motors. It's is an almost 1-to-1 mapping to platform APIs. Some platforms refer to these motors as left and right, and low frequency and high frequency, but by convention, they're usually the same. I used #3868 as a starting point, updated to main, removed the low-level gilrs effect API, and moved the requests to `bevy_input` and exposed the strong and weak intensities. I intend this to hopefully be a non-controversial cross-platform starting point we can build upon to eventually support more fine-grained control (closer to the gilrs effect API) --- ## Changelog ### Added - Gamepads can now be rumbled by sending the `GamepadRumbleRequest` event. --------- Co-authored-by: Nicola Papale <nico@nicopap.ch> Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com> Co-authored-by: Nicola Papale <nicopap@users.noreply.github.com> Co-authored-by: Bruce Reif (Buswolley) <bruce.reif@dynata.com>
22 lines
No EOL
706 B
TOML
22 lines
No EOL
706 B
TOML
[package]
|
|
name = "bevy_gilrs"
|
|
version = "0.11.0-dev"
|
|
edition = "2021"
|
|
description = "Gamepad system made using Gilrs for Bevy Engine"
|
|
homepage = "https://bevyengine.org"
|
|
repository = "https://github.com/bevyengine/bevy"
|
|
license = "MIT OR Apache-2.0"
|
|
keywords = ["bevy"]
|
|
|
|
[dependencies]
|
|
# bevy
|
|
bevy_app = { path = "../bevy_app", version = "0.11.0-dev" }
|
|
bevy_ecs = { path = "../bevy_ecs", version = "0.11.0-dev" }
|
|
bevy_input = { path = "../bevy_input", version = "0.11.0-dev" }
|
|
bevy_log = { path = "../bevy_log", version = "0.11.0-dev" }
|
|
bevy_utils = { path = "../bevy_utils", version = "0.11.0-dev" }
|
|
bevy_time = { path = "../bevy_time", version = "0.11.0-dev" }
|
|
|
|
# other
|
|
gilrs = "0.10.1"
|
|
thiserror = "1.0" |