| 
									
										
										
										
											2017-02-08 22:15:43 -05:00
										 |  |  | // Copyright 2017 Dolphin Emulator Project
 | 
					
						
							|  |  |  | // Licensed under GPLv2+
 | 
					
						
							|  |  |  | // Refer to the license.txt file included.
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <string>
 | 
					
						
							| 
									
										
										
										
											2018-12-29 16:06:03 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-03-26 19:31:03 -05:00
										 |  |  | #include "InputCommon/ControllerEmu/Setting/NumericSetting.h"
 | 
					
						
							| 
									
										
										
										
											2018-12-29 16:06:03 -06:00
										 |  |  | #include "InputCommon/ControllerEmu/StickGate.h"
 | 
					
						
							| 
									
										
										
										
											2017-04-04 15:37:31 -04:00
										 |  |  | #include "InputCommon/ControllerInterface/Device.h"
 | 
					
						
							| 
									
										
										
										
											2017-02-08 22:15:43 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | namespace ControllerEmu | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2018-12-29 16:06:03 -06:00
										 |  |  | class Tilt : public ReshapableInput | 
					
						
							| 
									
										
										
										
											2017-02-08 22:15:43 -05:00
										 |  |  | { | 
					
						
							|  |  |  | public: | 
					
						
							| 
									
										
										
										
											2018-12-30 10:52:45 -06:00
										 |  |  |   using StateData = ReshapeData; | 
					
						
							| 
									
										
										
										
											2018-07-13 11:04:40 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-08 22:15:43 -05:00
										 |  |  |   explicit Tilt(const std::string& name); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-30 10:52:45 -06:00
										 |  |  |   ReshapeData GetReshapableState(bool adjusted) final override; | 
					
						
							| 
									
										
										
										
											2019-02-04 18:50:07 -06:00
										 |  |  |   ControlState GetGateRadiusAtAngle(double angle) const final override; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Tilt is using the gate radius to adjust the tilt angle so we must provide an unadjusted value
 | 
					
						
							|  |  |  |   // for the default input radius.
 | 
					
						
							|  |  |  |   ControlState GetDefaultInputRadiusAtAngle(double angle) const final override; | 
					
						
							| 
									
										
										
										
											2017-02-08 22:15:43 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-30 09:10:32 -06:00
										 |  |  |   StateData GetState(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-08 22:15:43 -05:00
										 |  |  | private: | 
					
						
							| 
									
										
										
										
											2019-03-26 19:31:03 -05:00
										 |  |  |   SettingValue<double> m_max_angle_setting; | 
					
						
							| 
									
										
										
										
											2017-02-08 22:15:43 -05:00
										 |  |  | }; | 
					
						
							|  |  |  | }  // namespace ControllerEmu
 |