From 9fb93e5f7d77b49c7c8701dd7e54ef1c854749ab Mon Sep 17 00:00:00 2001 From: Joe Ardent Date: Tue, 21 Mar 2023 17:50:51 -0700 Subject: [PATCH] add input handling --- src/input.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/input.rs b/src/input.rs index 6d92d1a..c2965f3 100644 --- a/src/input.rs +++ b/src/input.rs @@ -57,8 +57,8 @@ fn update_input(mut events: EventReader, mut istate: ResMut istate.throttle = *value, - GamepadButtonType::LeftTrigger => istate.throttle = -value, + GamepadButtonType::RightTrigger2 => istate.throttle = *value, + GamepadButtonType::LeftTrigger2 => istate.throttle = -value, GamepadButtonType::East => { if value > &0.5 { istate.brake = true; @@ -74,6 +74,12 @@ fn update_input(mut events: EventReader, mut istate: ResMut { + istate.yaw = *value; + } + GamepadAxisType::RightStickY => { + istate.pitch = *value; + } _ => info!("unhandled axis event: {axis_event:?}"), } }