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

Handle wheel braking and steering More...

Inheritance diagram for AirControl.AC_Airplane_Wheel:
Collaboration diagram for AirControl.AC_Airplane_Wheel:

Public Member Functions

void initWheel ()
 Init wheel set the motor torque to very small nuber to allow it to roll freely More...
 
void HandleWheel (AC_BaseAirplane_Input input)
 Handle whele graphics, and steering More...
 

Public Attributes

bool isGrounded = false
 
Transform wheelGraphic
 
bool isBraking =false
 
bool isSteering =false
 
float motorTorque
 

Properties

bool IsGrounded [get]
 

Detailed Description

Handle wheel braking and steering

Definition at line 11 of file AC_Airplane_Wheel.cs.

Member Function Documentation

◆ HandleWheel()

void AirControl.AC_Airplane_Wheel.HandleWheel ( AC_BaseAirplane_Input  input)
inline

Handle whele graphics, and steering

Parameters
inputAirplane Input

Definition at line 81 of file AC_Airplane_Wheel.cs.

82  {
83  if(wheelCol)
84  {
85 
86  wheelCol.GetWorldPose(out worldPos, out worldRot);
87  if(wheelGraphic)
88  { //updating wheel rotation
89  wheelGraphic.rotation = worldRot;
90  wheelGraphic.position = worldPos;
91  }// handle Else
92  if (isBraking)
93  {
94  if(input.Brake > 0.1f)
95  {
96  //slowly apply brake
97  slowlyBrake = Mathf.Lerp(slowlyBrake,input.Brake*brakePower, Time.deltaTime );
98  wheelCol.brakeTorque = slowlyBrake;
99  // Release motor torque to move forward
100  wheelCol.motorTorque = 0.0f;
101  }
102  else
103  {
104  //relase the brake
105  slowlyBrake = 0f;
106  wheelCol.brakeTorque = 0.0f;
107  // small motor torque not to allow airplane roll backward
108  wheelCol.motorTorque = motorTorque;
109  }
110  }
111  if(isSteering)
112  {
113  wheelCol.steerAngle = -input.Yaw * steerAngle;
114  }
115 
116  // check to see if the wheels are grounded
117  isGrounded = wheelCol.isGrounded;
118 
119  }
120  }

◆ initWheel()

void AirControl.AC_Airplane_Wheel.initWheel ( )
inline

Init wheel set the motor torque to very small nuber to allow it to roll freely

Definition at line 70 of file AC_Airplane_Wheel.cs.

70  {
71 
72  if (wheelCol){
73  //setting wheel torque to really small, this way wheel dont exert ant force or get locked
74  wheelCol.motorTorque = 0.0000000001f;
75  }
76  }

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