summaryrefslogtreecommitdiffstats
path: root/src/core/frontend/input.h
diff options
context:
space:
mode:
authorwwylele <wwylele@gmail.com>2017-08-06 21:54:19 +0200
committerwwylele <wwylele@gmail.com>2017-08-11 10:03:18 +0200
commit867eabd6b7effc8ba6c21d7fcbd0480b14f81ad0 (patch)
tree8c4b98f7782e794f57603e20a44cea75e4788ea1 /src/core/frontend/input.h
parentMerge pull request #2874 from danzel/spelling-1 (diff)
downloadyuzu-867eabd6b7effc8ba6c21d7fcbd0480b14f81ad0.tar
yuzu-867eabd6b7effc8ba6c21d7fcbd0480b14f81ad0.tar.gz
yuzu-867eabd6b7effc8ba6c21d7fcbd0480b14f81ad0.tar.bz2
yuzu-867eabd6b7effc8ba6c21d7fcbd0480b14f81ad0.tar.lz
yuzu-867eabd6b7effc8ba6c21d7fcbd0480b14f81ad0.tar.xz
yuzu-867eabd6b7effc8ba6c21d7fcbd0480b14f81ad0.tar.zst
yuzu-867eabd6b7effc8ba6c21d7fcbd0480b14f81ad0.zip
Diffstat (limited to '')
-rw-r--r--src/core/frontend/input.h20
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