AirControl  1.3.0
Open Source, Modular, and Extensible Flight Simulator For Deep Learning Research
AirControl.AC_XboxAirplane_Input Class Reference

Child class listens to xbox Inputs More...

Inheritance diagram for AirControl.AC_XboxAirplane_Input:
Collaboration diagram for AirControl.AC_XboxAirplane_Input:

Protected Member Functions

override void HandleInputOld ()
 Handle Xbox input, override the keyboard behavior make sure you update input settings in Unity Then Only Xbox will work properly Refer to resources for setup More...
 
override void HandleInputNew ()
 
- Protected Member Functions inherited from AirControl.AC_BaseAirplane_Input
void ClampInputs ()
 Clamping inputs between limits More...
 
void IOSwitch ()
 Receive input from external program like python More...
 

Additional Inherited Members

- Public Attributes inherited from AirControl.AC_BaseAirplane_Input
int maxFlapIncrements =2
 
- Protected Attributes inherited from AirControl.AC_BaseAirplane_Input
float pitch = 0f
 
float roll = 0f
 
float yaw = 0f
 
float throttle = 0f
 
float brake = 0f
 
int flaps = 0
 
KeyCode cameraKey = KeyCode.C
 
bool camerSwitch = false
 
float throttleSpeed
 
float stickyThrottle
 
- Properties inherited from AirControl.AC_BaseAirplane_Input
float Pitch [get]
 
float Roll [get]
 
float Yaw [get]
 
float Throttle [get]
 
int Flaps [get]
 
float NormalizedFlaps [get]
 
float Brake [get]
 
float StickyThrottle [get]
 
bool CameraSwitch [get]
 

Detailed Description

Child class listens to xbox Inputs

Definition at line 10 of file AC_XboxAirplane_Input.cs.

Member Function Documentation

◆ HandleInputOld()

override void AirControl.AC_XboxAirplane_Input.HandleInputOld ( )
inlineprotectedvirtual

Handle Xbox input, override the keyboard behavior make sure you update input settings in Unity Then Only Xbox will work properly Refer to resources for setup

  1. https://answers.unity.com/questions/1350081/xbox-one-controller-mapping-solved.html
  2. https://www.udemy.com/course/intro-to-airplane-physics-in-unity-3d/learn/lecture/10348654#questions

Reimplemented from AirControl.AC_BaseAirplane_Input.

Definition at line 29 of file AC_XboxAirplane_Input.cs.

30  {
31  base.HandleInputOld();
32  base.ClampInputs();
33  // Process pitch, roll, yaw and throttle
34  pitch += Input.GetAxis("Vertical");
35  roll += Input.GetAxis("Horizontal");
36  yaw += Input.GetAxis("X_RH_Stick");
37 
38  throttle += Input.GetAxis("X_RV_Stick");
39  // Process brakes bool
40  brake = Input.GetAxis("Fire1");
41  // Process flaps
42  // get GetKeyDown is used because it fires only once when key pressed. GetKey constantly fire events
43  if(Input.GetButtonDown("X_R_Bumper")){
44  flaps+=1;
45  }
46  if(Input.GetButtonDown("X_L_Bumper")){
47  flaps-=1;
48  }
49  flaps = Mathf.Clamp(flaps, 0,maxFlapIncrements);
50 
51  // camera swith button
52  // camerSwitch = Input.GetButtonDown("X_Y_Button") || Input.GetKeyDown(cameraKey);
53 
54  }

The documentation for this class was generated from the following file: