Rise
The Vieneo Province
propulsion.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <WinSock2.h>
4 #include <WS2tcpip.h>
5 #include <Windows.h>
6 #include "DXUT.h"
7 
8 #include "../Logger.h"
9 #include "globals.h"
10 #include "../Bus.h"
11 
12 class Viewscreen;
13 
14 #define MaxCLDelta 0.800f
15 #define MaxCDDelta 0.060f
16 
17 /*
18  * Space Shuttle had a 2.5x rise in drag for 6.75 seconds ... that is a rise of 61.594 m/s over 6.75 seconds at 1g over gravity
19  * Tangent .625 from Paint Shop Pro freehand selection (32 degrees) on space shuttle design means that we would sin(32)x = 2.5 which is
20  * 4.7177x the angle that the shock cone makes ... 0 is 0, 90 is 4.7177
21  */
22 #define maxDragIncreaseApproachingMachC 3.7177f // 4.7177 minus 1 which is the default
23 
24 
26 {
28  {
29  Asymm = 1,
30  Symm = 2
31  };
32 
35 
37  float oldmsl, oldagl;
38  PlotType ambtype1;
39  char ambtype2;
40  float oldvol;
41  int chip;
42  float tach;
43  D3DXVECTOR3 actual;
44  bool trendup; // on the way up or down
45  float intensity; // from 0 to 1 then back to 0
46  D3DXVECTOR3 windgust;
48  float oldpitch;
50  float rougfric;
51  float f_netupdate;
52  char discordHeartbeat = 0;
53 
56 
57 
58  D3DXVECTOR3 oldOdoPosition; // for odometer
59  char oldOdoReference; // for odometer
60 
61  char msg[160];
62 
63  D3DXVECTOR3 localvel = centerC;
64  D3DXVECTOR3 windVectorTrueKms = centerC;
66 
67  static void GetFrictionCoefficients(unsigned char type, float* rollingResistance, float* roughness);
68  static float CalculateLiftCoefficient(AirfoilType type, float aoaRad, float CLDelta);
69  static float CalculateDragCoefficient(AirfoilType type, float aoa, float CDDelta);
70 
71 public:
72  bool initFromDeflect = false;
73  float totalWeightLbs = 0.0f;
74  float speedOfSoundKms = 0.343f;
75  float staticBuildup = 0.0f; // st. elmo fire
76  float airframeTempCelsius = -273.15f;
77  float iceAccumulationMm = 0;
78  float mach = 0.0f;
79  float tatCelsius = 0.0f;
80  float qz = 0.0f;
81  float convectionRate = 0.0f;
82  float tat_mod_qz_x = 0.0f;
83  float pitchAccelerationSnapshot = 0.0f, yawAccelerationSnapshot = 0.0f, rollAccelerationSnapshot = 0.0f; // snapshot means in a frame already adjusted for elapsedTime
84  float staticDensity = 1.0f; // used for sounds arriving from other vehicles, weapons, thunder
85  float dynamicDensity = 1.0f; // used for airfoils and wind noise
86 
87  propulsion(Viewscreen* ptr);
88  void Update(float fElapsedTime);
89  float GetTach() const;
90  void Reset();
91  float GetTotalThrust() const;
92 };
float EngineThrustOutput[MAX_ENGINES]
Definition: propulsion.h:55
float tat_mod_qz_x
Definition: propulsion.h:82
float rollAccelerationSnapshot
Definition: propulsion.h:83
float intensity
Definition: propulsion.h:45
float oldmsl
Definition: propulsion.h:37
#define MAX_ENGINES
Definition: Bus.h:14
float staticDensity
Definition: propulsion.h:84
float f_netupdate
Definition: propulsion.h:51
float gndcontactG
Definition: propulsion.h:36
char ambtype2
Definition: propulsion.h:39
float airframeTempCelsius
Definition: propulsion.h:76
float rougfric
Definition: propulsion.h:50
float dynamicDensity
Definition: propulsion.h:85
Definition: Logger.h:9
void Update(float fElapsedTime)
Definition: propulsion.cpp:125
float oldcorrection
Definition: propulsion.h:49
float GetTach() const
Logger * logger
Definition: propulsion.h:34
void Reset()
float yawAccelerationSnapshot
Definition: propulsion.h:83
float mach
Definition: propulsion.h:78
static float CalculateLiftCoefficient(AirfoilType type, float aoaRad, float CLDelta)
Definition: propulsion.cpp:47
float aoaRad
Definition: globals.cpp:33
float pitchAccelerationSnapshot
Definition: propulsion.h:83
float olddesiredvsi
Definition: propulsion.h:47
static void GetFrictionCoefficients(unsigned char type, float *rollingResistance, float *roughness)
Definition: propulsion.cpp:86
float oldagl
Definition: propulsion.h:37
char msg[160]
Definition: propulsion.h:61
D3DXVECTOR3 relativeWindTrueKms
Definition: propulsion.h:65
D3DXVECTOR3 actual
Definition: propulsion.h:43
bool trendup
Definition: propulsion.h:44
float ThrustReverserOutput[MAX_ENGINES]
Definition: propulsion.h:54
char oldOdoReference
Definition: propulsion.h:59
float qz
Definition: propulsion.h:80
bool initFromDeflect
Definition: propulsion.h:72
PlotType ambtype1
Definition: propulsion.h:38
float halfsec
Definition: propulsion.h:36
float oldvol
Definition: propulsion.h:40
const D3DXVECTOR3 centerC
static float CalculateDragCoefficient(AirfoilType type, float aoa, float CDDelta)
Definition: propulsion.cpp:71
D3DXVECTOR3 windgust
Definition: propulsion.h:46
Viewscreen * viewscreen
Definition: propulsion.h:33
float staticBuildup
Definition: propulsion.h:75
float tatCelsius
Definition: propulsion.h:79
float totalWeightLbs
Definition: propulsion.h:73
float tach
Definition: propulsion.h:42
char discordHeartbeat
Definition: propulsion.h:52
D3DXVECTOR3 windVectorTrueKms
Definition: propulsion.h:64
float oldpitch
Definition: propulsion.h:48
float GetTotalThrust() const
float speedOfSoundKms
Definition: propulsion.h:74
D3DXVECTOR3 localvel
Definition: propulsion.h:63
float convectionRate
Definition: propulsion.h:81
D3DXVECTOR3 oldOdoPosition
Definition: propulsion.h:58
propulsion(Viewscreen *ptr)
Definition: propulsion.cpp:10
float iceAccumulationMm
Definition: propulsion.h:77