diff options
Diffstat (limited to 'src/input_common/drivers/virtual_gamepad.cpp')
| -rw-r--r-- | src/input_common/drivers/virtual_gamepad.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/input_common/drivers/virtual_gamepad.cpp b/src/input_common/drivers/virtual_gamepad.cpp index 7db945aa6..c15cbbe58 100644 --- a/src/input_common/drivers/virtual_gamepad.cpp +++ b/src/input_common/drivers/virtual_gamepad.cpp | |||
| @@ -39,6 +39,22 @@ void VirtualGamepad::SetStickPosition(std::size_t player_index, VirtualStick axi | |||
| 39 | SetStickPosition(player_index, static_cast<int>(axis_id), x_value, y_value); | 39 | SetStickPosition(player_index, static_cast<int>(axis_id), x_value, y_value); |
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | void VirtualGamepad::SetMotionState(std::size_t player_index, u64 delta_timestamp, float gyro_x, | ||
| 43 | float gyro_y, float gyro_z, float accel_x, float accel_y, | ||
| 44 | float accel_z) { | ||
| 45 | const auto identifier = GetIdentifier(player_index); | ||
| 46 | const BasicMotion motion_data{ | ||
| 47 | .gyro_x = gyro_x, | ||
| 48 | .gyro_y = gyro_y, | ||
| 49 | .gyro_z = gyro_z, | ||
| 50 | .accel_x = accel_x, | ||
| 51 | .accel_y = accel_y, | ||
| 52 | .accel_z = accel_z, | ||
| 53 | .delta_timestamp = delta_timestamp, | ||
| 54 | }; | ||
| 55 | SetMotion(identifier, 0, motion_data); | ||
| 56 | } | ||
| 57 | |||
| 42 | void VirtualGamepad::ResetControllers() { | 58 | void VirtualGamepad::ResetControllers() { |
| 43 | for (std::size_t i = 0; i < PlayerIndexCount; i++) { | 59 | for (std::size_t i = 0; i < PlayerIndexCount; i++) { |
| 44 | SetStickPosition(i, VirtualStick::Left, 0.0f, 0.0f); | 60 | SetStickPosition(i, VirtualStick::Left, 0.0f, 0.0f); |