diff options
author | Narr the Reg <juangerman-13@hotmail.com> | 2023-02-22 04:47:47 +0100 |
---|---|---|
committer | Narr the Reg <juangerman-13@hotmail.com> | 2023-02-22 04:55:23 +0100 |
commit | 739a81055f8f33ab0987ee730370a0535a1bdf05 (patch) | |
tree | 8d7acb47d0b2915112f13aaa9542368cf8c5b8ce /src/core/hid/emulated_controller.cpp | |
parent | input_common: Implement dedicated motion from mouse (diff) | |
download | yuzu-739a81055f8f33ab0987ee730370a0535a1bdf05.tar yuzu-739a81055f8f33ab0987ee730370a0535a1bdf05.tar.gz yuzu-739a81055f8f33ab0987ee730370a0535a1bdf05.tar.bz2 yuzu-739a81055f8f33ab0987ee730370a0535a1bdf05.tar.lz yuzu-739a81055f8f33ab0987ee730370a0535a1bdf05.tar.xz yuzu-739a81055f8f33ab0987ee730370a0535a1bdf05.tar.zst yuzu-739a81055f8f33ab0987ee730370a0535a1bdf05.zip |
Diffstat (limited to 'src/core/hid/emulated_controller.cpp')
-rw-r--r-- | src/core/hid/emulated_controller.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp index 6d5a3dead..a29c9a6f8 100644 --- a/src/core/hid/emulated_controller.cpp +++ b/src/core/hid/emulated_controller.cpp @@ -363,7 +363,17 @@ void EmulatedController::ReloadInput() { SetMotion(callback, index); }, }); - motion_devices[index]->ForceUpdate(); + + // Restore motion state + auto& emulated_motion = controller.motion_values[index].emulated; + auto& motion = controller.motion_state[index]; + emulated_motion.ResetRotations(); + emulated_motion.ResetQuaternion(); + motion.accel = emulated_motion.GetAcceleration(); + motion.gyro = emulated_motion.GetGyroscope(); + motion.rotation = emulated_motion.GetRotations(); + motion.orientation = emulated_motion.GetOrientation(); + motion.is_at_rest = !emulated_motion.IsMoving(motion_sensitivity); } for (std::size_t index = 0; index < camera_devices.size(); ++index) { |