diff options
| author | 2017-08-19 23:43:01 -0600 | |
|---|---|---|
| committer | 2017-08-19 23:43:01 -0600 | |
| commit | bbfa9d0635ce4b9226bed02ea1b6e8ddbb7e8a56 (patch) | |
| tree | 5bfecf66096077d72346da902a9646314cb60631 /src/core/frontend/input.h | |
| parent | Merge pull request #2871 from wwylele/sw-spotlight (diff) | |
| parent | HID: fix a comment and a warning (diff) | |
| download | yuzu-bbfa9d0635ce4b9226bed02ea1b6e8ddbb7e8a56.tar.gz yuzu-bbfa9d0635ce4b9226bed02ea1b6e8ddbb7e8a56.tar.xz yuzu-bbfa9d0635ce4b9226bed02ea1b6e8ddbb7e8a56.zip | |
Merge pull request #2861 from wwylele/motion-refactor
Refactor MotionEmu into a InputDevice
Diffstat (limited to 'src/core/frontend/input.h')
| -rw-r--r-- | src/core/frontend/input.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/core/frontend/input.h b/src/core/frontend/input.h index 0a5713dc0..5916a901d 100644 --- a/src/core/frontend/input.h +++ b/src/core/frontend/input.h | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #include <utility> | 11 | #include <utility> |
| 12 | #include "common/logging/log.h" | 12 | #include "common/logging/log.h" |
| 13 | #include "common/param_package.h" | 13 | #include "common/param_package.h" |
| 14 | #include "common/vector_math.h" | ||
| 14 | 15 | ||
| 15 | namespace Input { | 16 | namespace Input { |
| 16 | 17 | ||
| @@ -107,4 +108,22 @@ using ButtonDevice = InputDevice<bool>; | |||
| 107 | */ | 108 | */ |
| 108 | using AnalogDevice = InputDevice<std::tuple<float, float>>; | 109 | using AnalogDevice = InputDevice<std::tuple<float, float>>; |
| 109 | 110 | ||
| 111 | /** | ||
| 112 | * A motion device is an input device that returns a tuple of accelerometer state vector and | ||
| 113 | * gyroscope state vector. | ||
| 114 | * | ||
| 115 | * For both vectors: | ||
| 116 | * x+ is the same direction as LEFT on D-pad. | ||
| 117 | * y+ is normal to the touch screen, pointing outward. | ||
| 118 | * z+ is the same direction as UP on D-pad. | ||
| 119 | * | ||
| 120 | * For accelerometer state vector | ||
| 121 | * Units: g (gravitational acceleration) | ||
| 122 | * | ||
| 123 | * For gyroscope state vector: | ||
| 124 | * Orientation is determined by right-hand rule. | ||
| 125 | * Units: deg/sec | ||
| 126 | */ | ||
| 127 | using MotionDevice = InputDevice<std::tuple<Math::Vec3<float>, Math::Vec3<float>>>; | ||
| 128 | |||
| 110 | } // namespace Input | 129 | } // namespace Input |