diff options
| author | 2020-09-17 12:39:01 -0700 | |
|---|---|---|
| committer | 2020-09-17 12:39:01 -0700 | |
| commit | 3f6d83b27cf3eb2e782185deeb852630037caa17 (patch) | |
| tree | febd2fb00d95ed955be4ed97acc9f4c21b2a5efa /src/core/frontend | |
| parent | Merge pull request #4668 from lioncash/port (diff) | |
| parent | configure_input: Hook up the motion button and checkbox (diff) | |
| download | yuzu-3f6d83b27cf3eb2e782185deeb852630037caa17.tar.gz yuzu-3f6d83b27cf3eb2e782185deeb852630037caa17.tar.xz yuzu-3f6d83b27cf3eb2e782185deeb852630037caa17.zip | |
Merge pull request #4594 from german77/MotionHID
hid/configuration: Implement motion controls to HID
Diffstat (limited to 'src/core/frontend')
| -rw-r--r-- | src/core/frontend/input.h | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/core/frontend/input.h b/src/core/frontend/input.h index 2b098b7c6..9da0d2829 100644 --- a/src/core/frontend/input.h +++ b/src/core/frontend/input.h | |||
| @@ -119,11 +119,11 @@ using ButtonDevice = InputDevice<bool>; | |||
| 119 | using AnalogDevice = InputDevice<std::tuple<float, float>>; | 119 | using AnalogDevice = InputDevice<std::tuple<float, float>>; |
| 120 | 120 | ||
| 121 | /** | 121 | /** |
| 122 | * A motion device is an input device that returns a tuple of accelerometer state vector and | 122 | * A motion status is an object that returns a tuple of accelerometer state vector, |
| 123 | * gyroscope state vector. | 123 | * gyroscope state vector, rotation state vector and orientation state matrix. |
| 124 | * | 124 | * |
| 125 | * For both vectors: | 125 | * For both vectors: |
| 126 | * x+ is the same direction as LEFT on D-pad. | 126 | * x+ is the same direction as RIGHT on D-pad. |
| 127 | * y+ is normal to the touch screen, pointing outward. | 127 | * y+ is normal to the touch screen, pointing outward. |
| 128 | * z+ is the same direction as UP on D-pad. | 128 | * z+ is the same direction as UP on D-pad. |
| 129 | * | 129 | * |
| @@ -133,8 +133,22 @@ using AnalogDevice = InputDevice<std::tuple<float, float>>; | |||
| 133 | * For gyroscope state vector: | 133 | * For gyroscope state vector: |
| 134 | * Orientation is determined by right-hand rule. | 134 | * Orientation is determined by right-hand rule. |
| 135 | * Units: deg/sec | 135 | * Units: deg/sec |
| 136 | * | ||
| 137 | * For rotation state vector | ||
| 138 | * Units: rotations | ||
| 139 | * | ||
| 140 | * For orientation state matrix | ||
| 141 | * x vector | ||
| 142 | * y vector | ||
| 143 | * z vector | ||
| 144 | */ | ||
| 145 | using MotionStatus = std::tuple<Common::Vec3<float>, Common::Vec3<float>, Common::Vec3<float>, | ||
| 146 | std::array<Common::Vec3f, 3>>; | ||
| 147 | |||
| 148 | /** | ||
| 149 | * A motion device is an input device that returns a motion status object | ||
| 136 | */ | 150 | */ |
| 137 | using MotionDevice = InputDevice<std::tuple<Common::Vec3<float>, Common::Vec3<float>>>; | 151 | using MotionDevice = InputDevice<MotionStatus>; |
| 138 | 152 | ||
| 139 | /** | 153 | /** |
| 140 | * A touch device is an input device that returns a tuple of two floats and a bool. The floats are | 154 | * A touch device is an input device that returns a tuple of two floats and a bool. The floats are |