From ff679f3d171ace12d1b3b68f305b1bb24b2130de Mon Sep 17 00:00:00 2001 From: german Date: Fri, 4 Sep 2020 21:48:03 -0500 Subject: Include HID and configuration changes related to motion --- src/core/frontend/input.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/core/frontend/input.h') diff --git a/src/core/frontend/input.h b/src/core/frontend/input.h index 2b098b7c6..6770475cf 100644 --- a/src/core/frontend/input.h +++ b/src/core/frontend/input.h @@ -136,6 +136,33 @@ using AnalogDevice = InputDevice>; */ using MotionDevice = InputDevice, Common::Vec3>>; +/** + * A real motion device is an input device 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 RIGHT 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 + * + * For rotation state vector + * Units: rotations + * + * For orientation state matrix + * x vector + * y vector + * z vector + */ +using RealMotionDevice = InputDevice, Common::Vec3, + Common::Vec3, std::array>>; + /** * A touch device is an input device that returns a tuple of two floats and a bool. The floats are * x and y coordinates in the range 0.0 - 1.0, and the bool indicates whether it is pressed. -- cgit v1.2.3 From 0774b17846fc7bd12bfe329fbaed6524d96c81cb Mon Sep 17 00:00:00 2001 From: german Date: Wed, 2 Sep 2020 19:59:34 -0500 Subject: Remove RealMotionDevice --- src/core/frontend/input.h | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) (limited to 'src/core/frontend/input.h') diff --git a/src/core/frontend/input.h b/src/core/frontend/input.h index 6770475cf..9da0d2829 100644 --- a/src/core/frontend/input.h +++ b/src/core/frontend/input.h @@ -119,25 +119,7 @@ using ButtonDevice = InputDevice; using AnalogDevice = InputDevice>; /** - * 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, Common::Vec3>>; - -/** - * A real motion device is an input device that returns a tuple of accelerometer 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: @@ -160,8 +142,13 @@ using MotionDevice = InputDevice, Common::Vec3, Common::Vec3, - Common::Vec3, std::array>>; +using MotionStatus = std::tuple, Common::Vec3, Common::Vec3, + std::array>; + +/** + * A motion device is an input device that returns a motion status object + */ +using MotionDevice = InputDevice; /** * A touch device is an input device that returns a tuple of two floats and a bool. The floats are -- cgit v1.2.3