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

Monitor and updates the tachometer to UI More...

Inheritance diagram for AirControl.AC_Airplane_Tachometer:
Collaboration diagram for AirControl.AC_Airplane_Tachometer:

Public Member Functions

void HandleAirplaneUI ()
 Updates to UI More...
 

Public Attributes

RectTransform pointer
 
float maxRPMIntachometer = 3500f
 

Detailed Description

Monitor and updates the tachometer to UI

Definition at line 12 of file AC_Airplane_Tachometer.cs.

Member Function Documentation

◆ HandleAirplaneUI()

void AirControl.AC_Airplane_Tachometer.HandleAirplaneUI ( )
inline

Updates to UI

Implements AirControl.IAirplaneUI.

Definition at line 36 of file AC_Airplane_Tachometer.cs.

37  {
38  if(engine && pointer)
39  {
40  float normalizedRPM = Mathf.InverseLerp(0f, (float)CommonFunctions.airplanePreset[CommonFunctions.activeAirplane+"/maxRPM"] , engine.CurrentRPM);
41  float radialspeed = 360f * normalizedRPM;
42  //smoothly move tachmeter
43  smoothrotation = Mathf.Lerp(smoothrotation, radialspeed, Time.deltaTime*0.1f);
44  pointer.rotation = Quaternion.Euler(0f,0f,-smoothrotation);
45  }
46 
47 
48  }

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