mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-31 13:50:03 +00:00 
			
		
		
		
	HID: use MotionDevice for Accelerometer and Gyroscope
This commit is contained in:
		
							parent
							
								
									53ef90d1bd
								
							
						
					
					
						commit
						867eabd6b7
					
				
					 3 changed files with 48 additions and 5 deletions
				
			
		|  | @ -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
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue