diff options
author | wwylele <wwylele@gmail.com> | 2017-08-06 22:54:19 +0300 |
---|---|---|
committer | wwylele <wwylele@gmail.com> | 2017-08-11 11:03:18 +0300 |
commit | 867eabd6b7effc8ba6c21d7fcbd0480b14f81ad0 (patch) | |
tree | 8c4b98f7782e794f57603e20a44cea75e4788ea1 /src/core/frontend/input.h | |
parent | 53ef90d1bde275367d71cb7d4658a7e7399da7e8 (diff) |
HID: use MotionDevice for Accelerometer and Gyroscope
Diffstat (limited to 'src/core/frontend/input.h')
-rw-r--r-- | src/core/frontend/input.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/core/frontend/input.h b/src/core/frontend/input.h index 0a5713dc0..a8be49440 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,23 @@ 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 accelerometer state vector: + * 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. + * Units: measured in unit of gravitational acceleration + * + * For gyroscope state vector: + * 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. + * Orientation is determined by right-hand rule. + * Units: deg/sec + */ +using MotionDevice = InputDevice<std::tuple<Math::Vec3<float>, Math::Vec3<float>>>; + } // namespace Input |