summaryrefslogtreecommitdiff
path: root/src/core/hid/emulated_controller.cpp
diff options
context:
space:
mode:
authorGravatar liamwhite2023-05-06 23:09:55 -0400
committerGravatar GitHub2023-05-06 23:09:55 -0400
commit9c9b4616c3eda641f3d370758587fa776fa1a87e (patch)
treed081194e1ea0b673a1cc01f7c00846374da70594 /src/core/hid/emulated_controller.cpp
parentMerge pull request #10178 from ronikirla/2-hour-crash (diff)
parentinput_common: Add property to invert an axis button (diff)
downloadyuzu-9c9b4616c3eda641f3d370758587fa776fa1a87e.tar.gz
yuzu-9c9b4616c3eda641f3d370758587fa776fa1a87e.tar.xz
yuzu-9c9b4616c3eda641f3d370758587fa776fa1a87e.zip
Merge pull request #10167 from german77/motion_preview
yuzu: Add motion preview to controller input
Diffstat (limited to 'src/core/hid/emulated_controller.cpp')
-rw-r--r--src/core/hid/emulated_controller.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp
index db71f1c19..ecab85893 100644
--- a/src/core/hid/emulated_controller.cpp
+++ b/src/core/hid/emulated_controller.cpp
@@ -376,6 +376,7 @@ void EmulatedController::ReloadInput() {
376 motion.accel = emulated_motion.GetAcceleration(); 376 motion.accel = emulated_motion.GetAcceleration();
377 motion.gyro = emulated_motion.GetGyroscope(); 377 motion.gyro = emulated_motion.GetGyroscope();
378 motion.rotation = emulated_motion.GetRotations(); 378 motion.rotation = emulated_motion.GetRotations();
379 motion.euler = emulated_motion.GetEulerAngles();
379 motion.orientation = emulated_motion.GetOrientation(); 380 motion.orientation = emulated_motion.GetOrientation();
380 motion.is_at_rest = !emulated_motion.IsMoving(motion_sensitivity); 381 motion.is_at_rest = !emulated_motion.IsMoving(motion_sensitivity);
381 } 382 }
@@ -980,14 +981,11 @@ void EmulatedController::SetMotion(const Common::Input::CallbackStatus& callback
980 emulated.UpdateOrientation(raw_status.delta_timestamp); 981 emulated.UpdateOrientation(raw_status.delta_timestamp);
981 force_update_motion = raw_status.force_update; 982 force_update_motion = raw_status.force_update;
982 983
983 if (is_configuring) {
984 return;
985 }
986
987 auto& motion = controller.motion_state[index]; 984 auto& motion = controller.motion_state[index];
988 motion.accel = emulated.GetAcceleration(); 985 motion.accel = emulated.GetAcceleration();
989 motion.gyro = emulated.GetGyroscope(); 986 motion.gyro = emulated.GetGyroscope();
990 motion.rotation = emulated.GetRotations(); 987 motion.rotation = emulated.GetRotations();
988 motion.euler = emulated.GetEulerAngles();
991 motion.orientation = emulated.GetOrientation(); 989 motion.orientation = emulated.GetOrientation();
992 motion.is_at_rest = !emulated.IsMoving(motion_sensitivity); 990 motion.is_at_rest = !emulated.IsMoving(motion_sensitivity);
993} 991}