diff options
author | James Rowe <jroweboy@gmail.com> | 2017-08-19 23:43:01 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-19 23:43:01 -0600 |
commit | bbfa9d0635ce4b9226bed02ea1b6e8ddbb7e8a56 (patch) | |
tree | 5bfecf66096077d72346da902a9646314cb60631 /src/core/frontend/input.h | |
parent | 8afa81ac1bbb0ffb67faf87e9ee696145a40bb99 (diff) | |
parent | 54c0c8adee90d374e954e742d6d03279ef2e7ed7 (diff) |
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 @@ #include <utility> #include "common/logging/log.h" #include "common/param_package.h" +#include "common/vector_math.h" namespace Input { @@ -107,4 +108,22 @@ using ButtonDevice = InputDevice<bool>; */ using AnalogDevice = InputDevice<std::tuple<float, float>>; +/** + * A motion device is an input device that returns a tuple of accelerometer state vector and + * gyroscope state vector. + * + * For both vectors: + * x+ is the same direction as LEFT on D-pad. + * y+ is normal to the touch screen, pointing outward. + * z+ is the same direction as UP on D-pad. + * + * For accelerometer state vector + * Units: g (gravitational acceleration) + * + * For gyroscope state vector: + * Orientation is determined by right-hand rule. + * Units: deg/sec + */ +using MotionDevice = InputDevice<std::tuple<Math::Vec3<float>, Math::Vec3<float>>>; + } // namespace Input |