diff options
author | bunnei <bunneidev@gmail.com> | 2020-09-17 12:39:01 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-17 12:39:01 -0700 |
commit | 3f6d83b27cf3eb2e782185deeb852630037caa17 (patch) | |
tree | febd2fb00d95ed955be4ed97acc9f4c21b2a5efa /src/core/frontend/input.h | |
parent | 382bf1faf42c1b8c6cf39398e5ba08177b9dd345 (diff) | |
parent | 5b6268d26a178f8104c7075daf24df37147a202b (diff) |
Merge pull request #4594 from german77/MotionHID
hid/configuration: Implement motion controls to HID
Diffstat (limited to 'src/core/frontend/input.h')
-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>; 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. + * A motion status is an object that returns a tuple of accelerometer state vector, + * gyroscope state vector, rotation state vector and orientation state matrix. * * For both vectors: - * x+ is the same direction as LEFT on D-pad. + * x+ is the same direction as RIGHT on D-pad. * y+ is normal to the touch screen, pointing outward. * z+ is the same direction as UP on D-pad. * @@ -133,8 +133,22 @@ using AnalogDevice = InputDevice<std::tuple<float, float>>; * For gyroscope state vector: * Orientation is determined by right-hand rule. * Units: deg/sec + * + * For rotation state vector + * Units: rotations + * + * For orientation state matrix + * x vector + * y vector + * z vector + */ +using MotionStatus = std::tuple<Common::Vec3<float>, Common::Vec3<float>, Common::Vec3<float>, + std::array<Common::Vec3f, 3>>; + +/** + * A motion device is an input device that returns a motion status object */ -using MotionDevice = InputDevice<std::tuple<Common::Vec3<float>, Common::Vec3<float>>>; +using MotionDevice = InputDevice<MotionStatus>; /** * A touch device is an input device that returns a tuple of two floats and a bool. The floats are |