4 #include "../MathUtilities.h" 8 #include "../Dialogs/InformationDialog.h" 49 if (type == AirfoilType::Asymm)
51 if (fabsf(
aoaRad) < 0.2618f)
52 return aoaRad / 0.2618f * 1.575f + 0.35f + CLDelta;
54 else if (type == AirfoilType::Symm)
56 if (fabsf(
aoaRad) < 0.2094395102f)
57 return aoaRad / 0.2094395102f * 1.2f + CLDelta;
76 float x = fmodf(fabsf(D3DXToDegree(aoa)), 180.0f);
77 float y = powf((sinf((x - 1.5708f) * .018f) * 0.5f + 0.5f), 4.8f) * 1.37f - 0.02f;
78 return min(1.35f, y + CDDelta);
90 case 0: *rollingResistance += 0.149252459f; *roughness += 0.140034499f;
break;
91 case 1: *rollingResistance += 3.0f;
break;
92 case 2: *rollingResistance += 0.155294699f; *roughness += 0.110395962f;
break;
93 case 3: *rollingResistance += 0.19890972f; *roughness += 0.075400626f;
break;
94 case 4: *rollingResistance += 0.3f; *roughness += 0.279197232f;
break;
95 case 5: *rollingResistance += 0.188024219f; *roughness += 0.16794517f;
break;
96 case 6: *rollingResistance += 0.142987307f; *roughness += 0.036592876f;
break;
97 case 7: *rollingResistance += 0.164080576f; *roughness += 0.041991001f;
break;
98 case 8: *rollingResistance += 0.137754924f; *roughness += 0.089029615f;
break;
99 case 9: *rollingResistance += 0.252407802f; *roughness += 0.250432014f;
break;
100 case 10: *rollingResistance += 0.031694275f; *roughness += 0.010107074f;
break;
101 case 11: *rollingResistance += 0.117426575f; *roughness += 0.110174209f;
break;
102 case 12: *rollingResistance += 0.143053466f; *roughness += 0.089767837f;
break;
103 case 13: *rollingResistance += 0.095765193f; *roughness += 0.018145682f;
break;
104 case 14: *rollingResistance += 0.18167668f; *roughness += 0.059555865f;
break;
105 case 15: *rollingResistance += 0.090375496f; *roughness += 0.039227343f;
break;
106 case 16: *rollingResistance += 0.0462223f; *roughness += 0.004436346f;
break;
107 case 17: *rollingResistance += 0.139361155f; *roughness += 0.109465749f;
break;
108 case 18: *rollingResistance += 0.243311063f; *roughness += 0.189429028f;
break;
109 case 19: *rollingResistance += 0.244358393f; *roughness += 0.214655836f;
break;
110 case 20: *rollingResistance += 0.110182991f; *roughness += 0.023593817f;
break;
111 case 21: *rollingResistance += 0.172887321f; *roughness += 0.092974959f;
break;
112 case 22: *rollingResistance += 0.251099364f; *roughness += 0.204277683f;
break;
113 case 23: *rollingResistance += 0.153308566f; *roughness += 0.124721617f;
break;
114 case 24: *rollingResistance += 0.014f; *roughness += 0.002153018f;
break;
115 case 25: *rollingResistance += 0.18702122f; *roughness += 0.04422358f;
break;
116 case 26: *rollingResistance += 0.142394658f; *roughness += 0.069383043f;
break;
117 case 27: *rollingResistance += 0.188285943f; *roughness += 0.127695657f;
break;
118 case 28: *rollingResistance += 0.065420895f; *roughness += 0.026730762f;
break;
119 case 29: *rollingResistance += 0.152859968f; *roughness += 0.100728901f;
break;
120 case 30: *rollingResistance += 0.240485841f; *roughness += 0.211254006f;
break;
121 case 31: *rollingResistance += 0.080389436f; *roughness += 0.01810045f;
break;
129 D3DXQUATERNION quaternionTemp;
130 D3DXMATRIX matrixInverse, matrixTemp;
131 D3DXVECTOR3 result, cross;
141 logger->
Log(
"weightC was calculated to be below the ourcockpit.emptyweight!", Logger::Level::Error);
159 D3DXMatrixRotationQuaternion(&matrixInverse, &
playerships[0].orientation);
160 D3DXMatrixInverse(&
playerships[0].matrixWorld,
nullptr, &matrixInverse);
167 if (matrixInverse._11 > 1000.0f || matrixInverse._11 < -1000.0f || _isnan(matrixInverse._11) || isinf(matrixInverse._11) ||
168 matrixInverse._12 > 1000.0f || matrixInverse._12 < -1000.0f || _isnan(matrixInverse._12) || isinf(matrixInverse._12) ||
169 matrixInverse._13 > 1000.0f || matrixInverse._13 < -1000.0f || _isnan(matrixInverse._13) || isinf(matrixInverse._13) ||
170 matrixInverse._14 > 1000.0f || matrixInverse._14 < -1000.0f || _isnan(matrixInverse._14) || isinf(matrixInverse._14))
172 sprintf_s(
msg,
sizeof(
msg),
"Trapped a violation after world matrix calculation...");
175 if (matrixInverse._21 > 1000.0f || matrixInverse._21 < -1000.0f || _isnan(matrixInverse._21) || isinf(matrixInverse._21) ||
176 matrixInverse._22 > 1000.0f || matrixInverse._22 < -1000.0f || _isnan(matrixInverse._22) || isinf(matrixInverse._22) ||
177 matrixInverse._23 > 1000.0f || matrixInverse._23 < -1000.0f || _isnan(matrixInverse._23) || isinf(matrixInverse._23) ||
178 matrixInverse._24 > 1000.0f || matrixInverse._24 < -1000.0f || _isnan(matrixInverse._24) || isinf(matrixInverse._24))
180 sprintf_s(
msg,
sizeof(
msg),
"Trapped a violation after world matrix calculation...");
183 if (matrixInverse._31 > 1000.0f || matrixInverse._31 < -1000.0f || _isnan(matrixInverse._31) || isinf(matrixInverse._31) ||
184 matrixInverse._32 > 1000.0f || matrixInverse._32 < -1000.0f || _isnan(matrixInverse._32) || isinf(matrixInverse._32) ||
185 matrixInverse._33 > 1000.0f || matrixInverse._33 < -1000.0f || _isnan(matrixInverse._33) || isinf(matrixInverse._33) ||
186 matrixInverse._34 > 1000.0f || matrixInverse._34 < -1000.0f || _isnan(matrixInverse._34) || isinf(matrixInverse._34))
188 sprintf_s(
msg,
sizeof(
msg),
"Trapped a violation after world matrix calculation...");
191 if (matrixInverse._41 > 1000.0f || matrixInverse._41 < -1000.0f || _isnan(matrixInverse._41) || isinf(matrixInverse._41) ||
192 matrixInverse._42 > 1000.0f || matrixInverse._42 < -1000.0f || _isnan(matrixInverse._42) || isinf(matrixInverse._42) ||
193 matrixInverse._43 > 1000.0f || matrixInverse._43 < -1000.0f || _isnan(matrixInverse._43) || isinf(matrixInverse._43) ||
194 matrixInverse._44 > 1000.0f || matrixInverse._44 < -1000.0f || _isnan(matrixInverse._44) || isinf(matrixInverse._44))
196 sprintf_s(
msg,
sizeof(
msg),
"Trapped a violation after world matrix calculation...");
206 D3DXVECTOR3 Tdockingvel;
208 D3DXVec3TransformNormal(&Tdockingvel, &
playerships[0].dockingvel, &matrixInverse);
221 f_temp = D3DXVec3Length(&result);
242 #pragma region Environmental Sound Effects (like waves and extractors) 251 if ((
gridarray[31][31].type == PlotType::UserMining ||
gridarray[31][31].type == PlotType::UserFarming ||
gridarray[31][31].type == PlotType::DeoisIndustrial)
255 newambtype = PlotType::NotZoned;
256 if ((
gridarray[31][31].pri_transition != 0 ||
gridarray[31][31].sec_transition != 0) &&
263 f_temp = D3DXVec3Length(&result);
268 newvolume = powf(f_temp, 2.0f);
269 newvolume = 1.0f - newvolume;
278 if (newambtype == PlotType::UserMining)
282 if (newambtype == PlotType::UserFarming)
286 if (newambtype == PlotType::DeoisIndustrial)
290 if (newambtype2 == 6)
306 result.x = 0.0f; result.y = 0.0f; result.z = -1.0f;
316 if (_isnan(result4.x) || _isnan(result4.y) || _isnan(result4.z) || isinf(result4.x) || isinf(result4.y) || isinf(result4.z))
317 logger->
Log(
"Ha! It was the SettingSpotDir with NAN values!", Logger::Level::Error);
327 logger->
Log(
"Exception thrown on ID3DXEffect->SetVector", Logger::Level::Error);
329 logger->
Log(
"-- viewscreen->gameclass->graphics->g_pEffect is not null", Logger::Level::Error);
331 logger->
Log(
"-- viewscreen->gameclass->graphics->g_pEffect IS NULL", Logger::Level::Error);
332 sprintf_s(
msg,
sizeof(
msg),
"-- result4 %f %f %f %f", result4.x, result4.y, result4.z, result4.w);
356 D3DXVECTOR3 groundvec, barycentric;
358 D3DXVec3TransformCoord(&barycentric, &
playerships[0].barycentric, &matrixInverse);
360 D3DXVec3Subtract(&groundvec, &barycentric, &
velocity);
363 if (groundvec.x > 100.0f || groundvec.x < -100.0f || _isnan(groundvec.x) || isinf(groundvec.x) ||
364 groundvec.y>100.0f || groundvec.y < -100.0f || _isnan(groundvec.y) || isinf(groundvec.y) ||
365 groundvec.z>100.0f || groundvec.z < -100.0f || _isnan(groundvec.z) || isinf(groundvec.z) ||
366 _isnan(barycentric.x) || _isnan(barycentric.y) || _isnan(barycentric.z) ||
367 isinf(barycentric.x) || isinf(barycentric.y) || isinf(barycentric.z))
369 sprintf_s(
msg,
sizeof(
msg),
"\tbarycentric I: %f", barycentric.x);
371 sprintf_s(
msg,
sizeof(
msg),
"\tbarycentric J: %f", barycentric.y);
373 sprintf_s(
msg,
sizeof(
msg),
"\tbarycentric K: %f", barycentric.z);
381 sprintf_s(
msg,
sizeof(
msg),
"\tour barycentric I: %f",
playerships[0].barycentric.x);
383 sprintf_s(
msg,
sizeof(
msg),
"\tour barycentric J: %f",
playerships[0].barycentric.y);
385 sprintf_s(
msg,
sizeof(
msg),
"\tour barycentric K: %f",
playerships[0].barycentric.z);
387 sprintf_s(
msg,
sizeof(
msg),
"Trapped a violation after groundvec calculation...");
395 D3DXVECTOR3 windDirectionOnly;
407 sprintf_s(
msg,
sizeof(
msg),
"Trapped a violation when windspeed was calculated...");
413 sprintf_s(
msg,
sizeof(
msg),
"\twinddir I: %f", windDirectionOnly.x);
415 sprintf_s(
msg,
sizeof(
msg),
"\twinddir J: %f", windDirectionOnly.y);
417 sprintf_s(
msg,
sizeof(
msg),
"\twinddir K: %f", windDirectionOnly.z);
447 float machWaveEffect;
449 machWaveEffect = powf(
mach, 12.622f);
451 machWaveEffect = 1.0f / ((powf(
mach + 0.169f, 2.0f) - 1.0f) * 2.73f);
465 if (
intensity == 0.0f && rand() % max(1, static_cast<int>(60.0f * fElapsedTime * turbChange * 10.0f)) == 0)
490 intensity += fElapsedTime / turbChange * 0.5f;
499 intensity -= fElapsedTime / turbChange * 0.5f;
510 sprintf_s(
msg,
sizeof(
msg),
"Trapped a violation after windspeed added gust factor...");
524 D3DXVECTOR3 localWindVector;
528 if (localWindVector.x > 100.0f || localWindVector.x < -100.0f || _isnan(localWindVector.x) || isinf(localWindVector.x) ||
529 localWindVector.y > 100.0f || localWindVector.y < -100.0f || _isnan(localWindVector.y) || isinf(localWindVector.y) ||
530 localWindVector.z > 100.0f || localWindVector.z < -100.0f || _isnan(localWindVector.z) || isinf(localWindVector.z))
532 sprintf_s(
msg,
sizeof(
msg),
"Trapped a violation after windspeed transformed by inverse matrix...");
546 sprintf_s(
msg,
sizeof(
msg),
"Trapped a violation after wind calculation...");
550 sprintf_s(
msg,
sizeof(
msg),
"\tgroundvec I: %f", groundvec.x);
552 sprintf_s(
msg,
sizeof(
msg),
"\tgroundvec J: %f", groundvec.y);
554 sprintf_s(
msg,
sizeof(
msg),
"\tgroundvec K: %f", groundvec.z);
556 sprintf_s(
msg,
sizeof(
msg),
"\tlocalWindVector I: %f", localWindVector.x);
558 sprintf_s(
msg,
sizeof(
msg),
"\tlocalWindVector J: %f", localWindVector.y);
560 sprintf_s(
msg,
sizeof(
msg),
"\tlocalWindVector K: %f", localWindVector.z);
575 D3DXVECTOR3 relativel;
590 if (network_objects.
reference == REF_INANOTHER && network_objects.
inarray == 0)
592 else if (network_objects.
reference < REF_INANOTHER)
593 relativel = network_objects.
velocity;
610 D3DXVECTOR3 location, tempvelocity;
611 D3DXVec3Normalize(&location, &
playerships[0].position);
614 D3DXVec3Cross(&cross, &location, &tempvelocity);
615 const float angle = D3DXVec3Dot(&location, &tempvelocity);
617 f_temp = -D3DX_HALFPI;
618 else if (angle <= -1.0f)
621 f_temp = -acosf(angle) - D3DX_HALFPI;
622 D3DXMatrixRotationAxis(&dor, &cross, f_temp);
623 D3DXVec3TransformCoord(&relativel, &tempvelocity, &dor);
624 D3DXVec3Normalize(&relativel, &relativel);
625 D3DXVec3Scale(&relativel, &relativel, -sqrtf(
gravityC *
radiusC / radius));
653 float engineCriticalAltitudeMod = 1.0f;
658 if (engineCriticalAltitudeMod < 0.0f)
659 engineCriticalAltitudeMod = 0.0f;
668 float antiIceEffectiveness = 0.0f;
670 antiIceEffectiveness =
static_cast<float>(
ourcockpit.
vdat.antiIce) / 127.0f;
673 float zThrustAvgPercent = 0.0f, zThrustAcceleration = 0.0f, zThrustAcceleration4FF = 0.0f, rcsThrustYPR = 0.0f;
749 logger->
Log(
"Yup, this was it... divide by zero error on ourcockpit.engines #1", Logger::Level::Debug);
755 f_temp *= leftHealth;
760 f_temp *= rightHealth;
765 f_temp *= centerHealth;
799 if (_isnan(zThrustAcceleration) || isinf(zThrustAcceleration))
801 logger->
Log(
"Yup, this was it...", Logger::Level::Debug);
810 zThrustAcceleration = 0.0f;
855 zThrustAcceleration *= engineCriticalAltitudeMod;
864 if (zThrustAcceleration < 0.0f)
865 zThrustAcceleration = 0.0f;
879 static float rcsThrustOutputX = 0.0f, rcsThrustOutputY = 0.0f, rcsThrustOutputZ = 0.0f;
926 float groundeffect = 1.0f;
927 if (!
ourcockpit.
gndvehicle && tempagl <= ourcockpit.wingspanM && ourcockpit.wingspanM > 0.0f && tempagl >= 0.0f)
939 float ratio = 999.0f;
957 if (_isnan(pedal) || isinf(pedal))
959 logger->
Log(
"Pedal died", Logger::Level::Fatal);
963 const float oldFuel =
fuel;
981 const float desired = pedal;
983 D3DXVec3TransformNormal(&result, &
locvelcomp, &matrixInverse);
985 const float speedometerKph = result.z * 60.0f * 60.0f;
986 float nettorque = 0.0f;
994 if (_isnan(actualTach) || isinf(actualTach))
996 logger->
Log(
"actual tach died", Logger::Level::Fatal);
1004 gauge = (desired + actualTach + actualTach + actualTach) * 0.25f;
1007 gauge =
Clamp(gauge, 0.0f, 1.0f);
1011 if (gauge < 0.1f && pedal>0.0f)
1013 clutch = 1.0f - gauge / 0.1f;
1026 float baseonpeak = 1.0f - fabsf(gauge - 0.733f);
1027 if (baseonpeak > 1.0f)
1029 else if (baseonpeak < 0.0f)
1043 float effective = desired - actualTach;
1044 if (effective > 1.0f)
1076 if (game->advanceframe)
1079 _sopen_s(&
chip,
"chip.bin", _O_WRONLY | O_TEXT | _O_CREAT | O_TRUNC, _SH_DENYWR, _S_IWRITE);
1081 sprintf_s(chipmsg,
sizeof(chipmsg),
"(g/s %5.1f kph)(gear %+i/%4.2f)(pedal %2.1f/fz%.3f)(actual %2.1f/%4.0f RPM)(gauge %2.1f/%4.0f RPM/peak %2.1f)(torque %+.4f net %.4f (%2.1f))\n",
1082 speedometer,
ourcockpit.
gearshift, ratio, desired, game->gameclass->bus->EngineThrustLever[0], actualTach, actualTach * 7500.0f, gauge, gauge * 7500.0f, baseonpeak,
1083 torque, nettorque, effective);
1084 _lseek(
chip, 0L, SEEK_SET);
1085 _write(
chip, chipmsg, strlen(chipmsg));
1152 result.x =
actual.x * fElapsedTime; result.y =
actual.y * fElapsedTime; result.z =
actual.z * fElapsedTime;
1156 #pragma region debug 1157 if (result.x > 100.0f || result.x < -100.0f || _isnan(result.x) || isinf(result.x) ||
1158 result.y > 100.0f || result.y < -100.0f || _isnan(result.y) || isinf(result.y) ||
1159 result.z > 100.0f || result.z < -100.0f || _isnan(result.z) || isinf(result.z))
1161 sprintf_s(
msg,
sizeof(
msg),
"\tET: %f", fElapsedTime);
1163 sprintf_s(
msg,
sizeof(
msg),
"\tactual I: %f",
actual.x);
1165 sprintf_s(
msg,
sizeof(
msg),
"\tactual J: %f",
actual.y);
1167 sprintf_s(
msg,
sizeof(
msg),
"\tactual K: %f",
actual.z);
1169 sprintf_s(
msg,
sizeof(
msg),
"\tresult I: %f", result.x);
1171 sprintf_s(
msg,
sizeof(
msg),
"\tresult J: %f", result.y);
1173 sprintf_s(
msg,
sizeof(
msg),
"\tresult K: %f", result.z);
1179 sprintf_s(
msg,
sizeof(
msg),
"\tzThrustAcceleration: %f", zThrustAcceleration);
1181 sprintf_s(
msg,
sizeof(
msg),
"Trapped a violation after xy thrust spoolup...");
1188 #pragma region debug 1189 if (result.x > 100.0f || result.x < -100.0f || _isnan(result.x) || isinf(result.x) ||
1190 result.y > 100.0f || result.y < -100.0f || _isnan(result.y) || isinf(result.y) ||
1191 result.z > 100.0f || result.z < -100.0f || _isnan(result.z) || isinf(result.z))
1193 sprintf_s(
msg,
sizeof(
msg),
"\tET: %f", fElapsedTime);
1199 sprintf_s(
msg,
sizeof(
msg),
"\tfuel: %f",
fuel);
1205 sprintf_s(
msg,
sizeof(
msg),
"\tresult I: %f", result.x);
1207 sprintf_s(
msg,
sizeof(
msg),
"\tresult J: %f", result.y);
1209 sprintf_s(
msg,
sizeof(
msg),
"\tresult K: %f", result.z);
1211 sprintf_s(
msg,
sizeof(
msg),
"Trapped a violation after weight adjustment spoolup...");
1220 #pragma region debug 1225 sprintf_s(
msg,
sizeof(
msg),
"\tET: %f", fElapsedTime);
1233 sprintf_s(
msg,
sizeof(
msg),
"\tresult I: %f", result.x);
1235 sprintf_s(
msg,
sizeof(
msg),
"\tresult J: %f", result.y);
1237 sprintf_s(
msg,
sizeof(
msg),
"\tresult K: %f", result.z);
1240 sprintf_s(
msg,
sizeof(
msg),
"Trapped a violation after thrust adjusted...");
1249 #pragma region Atmospheric Physics 1261 float tempDragTail = 0.0f;
1265 static float fullsec = 0.0f;
1266 fullsec += fElapsedTime;
1309 const float molarMass = 0.9914103f + 29.5230397f / (1.0f + powf(max(
f_MSL, 0) / 378.4386f, 1.425581f));
1310 const float molarMassMod = 29.0f / molarMass;
1314 sprintf_s(
msg, 160,
"speedOfSoundKms was NAN, OAT %.3f MMM %.3f", outsideAirTemperatureKelvin, molarMassMod);
1334 #pragma region Thermodynamics
1343 float radiationRate = 0.001f * 0.000000056703f * (powf(outsideAirTemperatureKelvin, 4.0f) - powf(airframeTempKelvin, 4.0f)) * (
ourcockpit.
i12WingAreaOneSideSqFt * 4.0f * 0.092903f) * 0.000526565066841f;
1346 if (radiationRate > 0)
1352 if (
playerships[0].baydoor) outsideConductionRate *= 1.2f;
1356 static int tempDumpFile = -1;
1357 if (tempDumpFile == -1)
1358 _sopen_s(&tempDumpFile,
"tempdata.log", _O_RDWR | _O_CREAT | _O_TRUNC | _O_TEXT | _O_SEQUENTIAL, SH_DENYWR, S_IWRITE);
1362 sprintf_s(msg1, 999,
"Alt: %.1f D: %.3f M: %.3f Q: %.3f SAT: %.1f AFT: %.1f TAT: %.1f Q*TAT: %.0f Rad/s: %.6f Cnv/s: %.6f OCnd/s: %.6f\n",
1365 _write(tempDumpFile, msg1, strlen(msg1));
1385 static bool favorLeft = rand() % 2 == 0;
1386 static float leftWing = 0.0f;
1387 static float rightWing = 0.0f;
1390 if (leftWing >= 1.0f)
1396 favorLeft = rand() % 2 == 0;
1408 if (rightWing >= 1.0f)
1414 favorLeft = rand() % 2 == 0;
1431 #pragma region Icing 1432 float cloudSeverity = 0.0f;
1439 cloudSeverity *= 0.285714f;
1456 float temperatureSeverity = 0.0f;
1459 const float iceIntensity = min(dropSeverity + cloudSeverity, 1.0f) * temperatureSeverity;
1460 const float iceAccretion = tas / 16.0f * fElapsedTime * 25.0f * iceIntensity;
1461 if (iceAccretion > 0)
1469 const float sublimation = 1.143f / 135.224f * fElapsedTime;
1478 float melt = probeTempCelsius / 70.0f * 18.288f / 135.224f * fElapsedTime;
1484 if (leadingEdgeTempCelsius > 0)
1486 melt = leadingEdgeTempCelsius / 107.0f * 18.288f / 135.224f * fElapsedTime;
1496 const float liftIceMod = max(0.5f, 1.0f - 0.003f * powf(
iceAccumulationMm, 2.0f));
1500 static int iceDumpFile = -1;
1501 if (iceDumpFile == -1)
1502 _sopen_s(&iceDumpFile,
"icedata.log", _O_RDWR | _O_CREAT | _O_TRUNC | _O_TEXT | _O_SEQUENTIAL, SH_DENYWR, S_IWRITE);
1506 sprintf_s(msg1, 999,
"MSL: %.3f TAS: %.3f DSV: %.1f TSV: %.1f CSV: %.1f THK: %.1f SAT: %+.1f AFT: %+.1f INT: %.1f ACC: %.3f I/D: %.1f (%i) A/F: %.1f SUB: %.1f LET: %.1f (%i) LFT: %.1f DRG: %.1f\n",
1507 f_MSL, tas, dropSeverity, temperatureSeverity, cloudSeverity,
viewscreen->
ptrWeather->
cloudThickness,
viewscreen->
ptrWeather->
GetTemperatureCelsius(),
airframeTempCelsius, iceIntensity, iceAccretion,
1510 _write(iceDumpFile, msg1, strlen(msg1));
1544 if (f_deflect > 1.0f)
1547 f_deflect = sqrtf(1.0f - f_deflect);
1548 if (f_deflect < 0.25f)
1570 Swaypoint currentWaypoint = Swaypoint();
1578 throw std::exception(
"Trying to use a waypoint that doesn't exist in collection for G/S!");
1581 float dme = D3DXVec3Length(&result);
1651 if (diff > 0.052359877559829887307710723054658f)
1652 diff = 0.052359877559829887307710723054658f;
1653 else if (diff < -0.052359877559829887307710723054658f)
1654 diff = -0.052359877559829887307710723054658f;
1672 if (diff > 0.052359877559829887307710723054658f)
1673 diff = 0.052359877559829887307710723054658f;
1674 else if (diff < -0.052359877559829887307710723054658f)
1675 diff = -0.052359877559829887307710723054658f;
1695 float desiredrate =
Clamp(deltapitch * 0.3f, -0.05236f, 0.05236f);
1709 float magnify = 1.0f;
1713 if (magnify > 10.0f)
1715 else if (magnify < 0.1f)
1718 desiredrate *= magnify;
1771 throw std::exception(
"Trying to use a waypoint that doesn't exist in collection for NAV/LOC!");
1773 const float dist = D3DXVec3Length(&result) -
f_MSL;
1778 throw std::exception(
"Trying to use a waypoint that doesn't exist in collection for LOC!");
1784 Swaypoint runwayWaypoint = Swaypoint();
1792 if (hdgdiff > 180.0f)
1796 if (dist < 0.5f && fabsf(hdgdiff) < 30.0f && runwayIndex)
1824 if (hdg2obj > 360.0f)
1826 else if (hdg2obj <= 0.0f)
1832 if (correct > 180.0f)
1834 else if (correct < -180.0f)
1836 if (correct > 90.0f)
1837 correct = 180.0f - correct;
1838 else if (correct < -90.0f)
1839 correct = -180.0f - correct;
1841 if (correct > 45.0f)
1843 else if (correct < -45.0f)
1846 correct *= dist * 0.25f;
1850 if (trkadj > 360.0f)
1852 else if (trkadj <= 0.0f)
1870 if (desiredrollDegrees < -180.0f)
1871 desiredrollDegrees = 360.0f + desiredrollDegrees;
1872 else if (desiredrollDegrees > 180.0f)
1873 desiredrollDegrees = desiredrollDegrees - 360.0f;
1887 float desiredrate = deltaroll * 0.3f;
1890 if (desiredrate > 0.17453292519943295769236907684886f)
1891 desiredrate = 0.17453292519943295769236907684886f;
1892 else if (desiredrate < -0.17453292519943295769236907684886f)
1893 desiredrate = -0.17453292519943295769236907684886f;
1943 #pragma region debug 1954 sprintf_s(
msg,
sizeof(
msg),
"\tf_deflect: %f", f_deflect);
1956 sprintf_s(
msg,
sizeof(
msg),
"Trapped a violation computing propulsion...");
1968 rollThrustTotal =
Clamp(rollThrustTotal, -1.0, 1.0f) * 870.0f * 60.0f;
1971 const float rollRightThrustLeftSide = rollThrustTotal * max(0, static_cast<float>(
ourcockpit.
vdat.leftwing)) / 127.0f;
1972 const float rollRightThrustRightSide = rollThrustTotal * max(0, static_cast<float>(
ourcockpit.
vdat.rightwing)) / 127.0f;
1974 yawThrust =
Clamp(yawThrust, -1.0f, 1.0f) * 870.0f * 200.0f;
1975 pitchThrust =
Clamp(pitchThrust, -1.0f, 1.0f) * 870.0f * 134.0f;
1977 rcsThrustYPR = (fabsf(rollRightThrustLeftSide + rollRightThrustRightSide) + fabsf(yawThrust) + fabsf(pitchThrust)) /
totalWeightLbs *
gForceKmSSC;
1993 command.
name =
"AuralStall";
1999 command.
name =
"AuralOverspeed";
2006 const float flapCLDelta =
MaxCLDelta * flapTemp;
2007 const float flapCDDelta =
MaxCDDelta * flapTemp;
2019 float tempLiftWingRight = 0.0f;
float tempDragWingRight = 0.0f;
2024 const float aileronCLDelta =
MaxCLDelta * aileronTemp;
2025 const float aileronCDDelta =
MaxCDDelta * fabsf(aileronTemp);
2031 tempLiftWingRight = Cl * tempq * S *
static_cast<float>(
ourcockpit.
vdat.rightwing) / 127.0f * liftIceMod;
2033 tempDragWingRight = Cd * tempq * S *
static_cast<float>(
ourcockpit.
vdat.rightwing) / 127.0f * dragIceMod;
2040 float tempLiftWingLeft = 0.0f;
float tempDragWingLeft = 0.0f;
2045 const float aileronCLDelta =
MaxCLDelta * aileronTemp;
2046 const float aileronCDDelta =
MaxCDDelta * fabsf(aileronTemp);
2052 tempLiftWingLeft = Cl * tempq * S *
static_cast<float>(
ourcockpit.
vdat.leftwing) / 127.0f * liftIceMod;
2054 tempDragWingLeft = Cd * tempq * S *
static_cast<float>(
ourcockpit.
vdat.leftwing) / 127.0f * dragIceMod;
2059 f_temp = (tempLiftWingRight + tempLiftWingLeft + rollRightThrustLeftSide - rollRightThrustRightSide) *
gForceKmSSC /
totalWeightLbs * fElapsedTime;
2060 f_temp *= groundeffect;
2062 sprintf_s(
msg,
sizeof(
msg),
"X%7.3f Y%7.3f Z%7.3f wing lift", 0.0f, f_temp *
oneOvergForceKmSSC / fElapsedTime, 0.0f);
2067 #pragma region debug 2072 sprintf_s(
msg,
sizeof(
msg),
"\tET: %f", fElapsedTime);
2080 sprintf_s(
msg,
sizeof(
msg),
"\tlift2: %f", f_temp);
2084 sprintf_s(
msg,
sizeof(
msg),
"\ttempLiftWingRight: %f", tempLiftWingRight);
2086 sprintf_s(
msg,
sizeof(
msg),
"\ttempLiftWingLeft: %f", tempLiftWingLeft);
2088 sprintf_s(
msg,
sizeof(
msg),
"\trollRightThrustLeftSide: %f", rollRightThrustLeftSide);
2090 sprintf_s(
msg,
sizeof(
msg),
"\trollRightThrustRightSide: %f", rollRightThrustRightSide);
2092 sprintf_s(
msg,
sizeof(
msg),
"\tgroundeffect: %f", groundeffect);
2095 sprintf_s(
msg,
sizeof(
msg),
"Trapped a violation after lift2 application...");
2125 float tempLiftElevator = 0.0f;
2129 tempaoa = -
aoaRad + 0.03f;
2134 const float elevatorCLDelta =
MaxCLDelta * elevatorTemp;
2135 const float elevatorCDDelta =
MaxCDDelta * fabsf(elevatorTemp);
2138 tempLiftElevator = Cl *
qz * S * max(0, static_cast<float>(
ourcockpit.
vdat.htail)) / 127.0f * liftIceMod;
2140 tempDragTail += Cd *
qz * S * max(0, static_cast<float>(
ourcockpit.
vdat.htail)) / 127.0f * dragIceMod;
2141 if (_isnan(tempDragTail) || isinf(tempDragTail))
2143 sprintf_s(
msg,
sizeof(
msg),
"Going to crap out on air friction tempDragHTail!");
2146 sprintf_s(
msg,
sizeof(
msg),
"Cd: %f", Cd);
2148 sprintf_s(
msg,
sizeof(
msg),
"qz: %f",
qz);
2150 sprintf_s(
msg,
sizeof(
msg),
"S: %f", S);
2154 sprintf_s(
msg,
sizeof(
msg),
"dragIceMod: %f", dragIceMod);
2164 sprintf_s(
msg,
sizeof(
msg),
"X%7.3f Y%7.3f Z%7.3f htail lift", 0.0f, f_temp *
oneOvergForceKmSSC / fElapsedTime, 0.0f);
2169 #pragma region debug 2174 sprintf_s(
msg,
sizeof(
msg),
"\tET: %f", fElapsedTime);
2182 sprintf_s(
msg,
sizeof(
msg),
"\tlift: %f", f_temp);
2185 sprintf_s(
msg,
sizeof(
msg),
"Trapped a violation after lift application...");
2218 #pragma region Directional Moment 2219 float tempLiftRudder = 0.0f;
2226 tempaoa = D3DX_HALFPI;
2235 tempLiftRudder = Cl *
qz * S *
static_cast<float>(
ourcockpit.
vdat.vtail) / 127.0f * liftIceMod;
2237 tempDragTail += Cd *
qz * S *
static_cast<float>(
ourcockpit.
vdat.vtail) / 127.0f * dragIceMod;
2238 if (_isnan(tempDragTail) || isinf(tempDragTail))
2240 sprintf_s(
msg,
sizeof(
msg),
"Going to crap out on air friction tempDragVTail!");
2243 sprintf_s(
msg,
sizeof(
msg),
"Cd: %f", Cd);
2245 sprintf_s(
msg,
sizeof(
msg),
"qz: %f",
qz);
2247 sprintf_s(
msg,
sizeof(
msg),
"S: %f", S);
2251 sprintf_s(
msg,
sizeof(
msg),
"dragIceMod: %f", dragIceMod);
2268 float business = 0.0f;
2365 f_temp *= fElapsedTime;
2383 if (_isnan(result.z) || isinf(result.z))
2385 sprintf_s(
msg,
sizeof(
msg),
"Going to crap out on air friction result.z!");
2388 sprintf_s(
msg,
sizeof(
msg),
"f_temp: %f", f_temp);
2398 sprintf_s(
msg,
sizeof(
msg),
"tempDragWingRight: %f", tempDragWingRight);
2400 sprintf_s(
msg,
sizeof(
msg),
"tempDragWingLeft: %f", tempDragWingLeft);
2402 sprintf_s(
msg,
sizeof(
msg),
"tempDragTail: %f", tempDragTail);
2406 sprintf_s(
msg,
sizeof(
msg),
"fElapsedTime: %f", fElapsedTime);
2425 if (result.x > 100.0f || result.x < -100.0f || _isnan(result.x) || isinf(result.x) ||
2426 result.y > 100.0f || result.y < -100.0f || _isnan(result.y) || isinf(result.y) ||
2427 result.z > 100.0f || result.z < -100.0f || _isnan(result.z) || isinf(result.z))
2429 sprintf_s(
msg,
sizeof(
msg),
"ET: %f", fElapsedTime);
2431 sprintf_s(
msg,
sizeof(
msg),
"Result I: %f", result.x);
2433 sprintf_s(
msg,
sizeof(
msg),
"Result J: %f", result.y);
2435 sprintf_s(
msg,
sizeof(
msg),
"Result K: %f", result.z);
2447 sprintf_s(
msg,
sizeof(
msg),
"f_temp: %f", f_temp);
2451 sprintf_s(
msg,
sizeof(
msg),
"Trapped a violation after air friction...");
2485 sprintf_s(
msg,
sizeof(
msg),
"X%7.3f Y%7.3f Z%7.3f parent",
2493 #pragma region debug 2499 sprintf_s(
msg,
sizeof(
msg),
"ET: %f", fElapsedTime);
2514 sprintf_s(
msg,
sizeof(
msg),
"Trapped a violation before sumofforces application...");
2533 sprintf_s(
msg,
sizeof(
msg),
"ET: %f", fElapsedTime);
2547 sprintf_s(
msg,
sizeof(
msg),
"Trapped a violation after putting velocity in universe terms...");
2556 D3DXVECTOR3 sumOfForcesNormal;
2557 D3DXVec3Normalize(&sumOfForcesNormal, &
sumofforces);
2560 D3DXVec3TransformNormal(&loclev, &
leveler, &matrixInverse);
2567 D3DXVECTOR3 locgrav;
2570 const float cmDot = D3DXVec3Dot(&locgrav, &sumOfForcesNormal);
2580 D3DXVECTOR3 locvel =
velocity - barycentric;
2581 D3DXVec3Normalize(&cross, &locvel);
2582 const float f_temp2 = D3DXVec3Dot(&cross, &loclev);
2584 D3DXVECTOR3 gravport;
2591 cross.y = locvel.y * fabsf(loclev.y);
2603 float shock = -cross.y / fElapsedTime;
2615 if (absorb > (shock * fElapsedTime))
2616 absorb = shock * fElapsedTime;
2618 sprintf_s(
msg,
sizeof(
msg),
"X%7.3f Y%7.3f Z%7.3f struts", 0.0f, -absorb *
oneOvergForceKmSSC / fElapsedTime, 0.0f);
2623 if (fabsf(cross.y) >= 0.001f)
2625 sprintf_s(
msg,
sizeof(
msg),
"*** TD force was %.3f/f (%.3f/s), absorbed %.3f/f (%.3f/s)", -cross.y, -cross.y / fElapsedTime, absorb, absorb / fElapsedTime);
2630 D3DXVec3TransformNormal(&cross, &cross, &
playerships[0].matrixWorld);
2637 #pragma region Ground Friction 2639 if (_isnan(locvel.x) || _isnan(locvel.y) || _isnan(locvel.z) ||
2640 isinf(locvel.x) || isinf(locvel.y) || isinf(locvel.z))
2642 logger->
Log(
"Skipping ground friction, locvel had NAN components!", Logger::Level::Debug);
2646 D3DXVECTOR3 newlocvel = cross = locvel;
2658 float rollingResistance, roughness, slideFrictionKineticCoeff;
2663 rollingResistance = 0.017f;
2664 slideFrictionKineticCoeff = 0.7f;
2669 rollingResistance = 0.014f;
2670 slideFrictionKineticCoeff = 1.0f;
2676 slideFrictionKineticCoeff = 0.6f;
2677 rollingResistance = roughness = 0.0f;
2686 rollingResistance /= 3.0f;
2691 rollingResistance *= 0.5f;
2696 rollingResistance *= 0.1f;
2700 rollingResistance *= 75.0f;
2703 if (_isnan(rollingResistance) || isinf(rollingResistance))
2705 rollingResistance = 0.0f;
2708 if (_isnan(roughness) || isinf(roughness))
2715 static float targetRoughness = roughness;
2716 float diff = targetRoughness -
rougfric;
2717 if (fabsf(diff) < 0.0001f)
2719 targetRoughness =
RandomFloat() * roughness * 2.0f;
2722 if (_isnan(targetRoughness) || isinf(targetRoughness))
2724 targetRoughness = 0.0f;
2727 if (_isnan(diff) || isinf(diff))
2737 sprintf_s(
msg,
sizeof(
msg),
"diff: %f", diff);
2739 sprintf_s(
msg,
sizeof(
msg),
"fElapsedTime: %f", fElapsedTime);
2741 sprintf_s(
msg,
sizeof(
msg),
"rougfric was %f before +=",
rougfric);
2750 sprintf_s(
msg,
sizeof(
msg),
"diff: %f", diff);
2752 sprintf_s(
msg,
sizeof(
msg),
"fElapsedTime: %f", fElapsedTime);
2754 sprintf_s(
msg,
sizeof(
msg),
"rougfric was %f after +=",
rougfric);
2758 if (_isnan(fElapsedTime) || isinf(fElapsedTime))
2760 fElapsedTime = 0.0f;
2775 float slidingFriction;
2776 if (fabsf(newlocvel.z) < FLT_EPSILON)
2780 const float rollfric = (rollingResistance +
rougfric) *
gndcontactG * 0.001f * fElapsedTime;
2787 if (_isnan(slidingFriction) || isinf(slidingFriction))
2789 sprintf_s(
msg,
sizeof(
msg),
"slideFrictionKineticCoeff: %f", slideFrictionKineticCoeff);
2797 sprintf_s(
msg,
sizeof(
msg),
"fElapsedTime: %f", fElapsedTime);
2801 sprintf_s(
msg,
sizeof(
msg),
"Trapped a violation with sliding friction...");
2804 slidingFriction = 0.0f;
2808 if (slidingFriction > (
gravityC * fElapsedTime))
2810 slidingFriction =
gravityC * fElapsedTime;
2813 else if (slidingFriction < -(
gravityC * fElapsedTime))
2815 slidingFriction = -
gravityC * fElapsedTime;
2840 if (newlocvel.x > 0.0f)
2842 newlocvel.x -= slidingFriction;
2843 if (newlocvel.x < 0.0f)
2846 else if (newlocvel.x < 0.0f)
2848 newlocvel.x += slidingFriction;
2849 if (newlocvel.x > 0.0f)
2854 float dynamicMod = 0.0f;
2855 float effectiveLeftBrake, effectiveRightBrake;
2857 effectiveLeftBrake = effectiveRightBrake = 0.5f *
static_cast<float>(
ourcockpit.
vdat.parkingBrake) / 127.0f;
2874 effectiveLeftBrake = effectiveRightBrake = 1.0f;
2875 effectiveLeftBrake *= 0.270453f;
2876 effectiveRightBrake *= 0.270453f;
2877 effectiveLeftBrake *=
static_cast<float>(
ourcockpit.
vdat.leftBrake) / 127.0f;
2878 effectiveRightBrake *=
static_cast<float>(
ourcockpit.
vdat.rightBrake) / 127.0f;
2889 if (dynamicMod > 1.0f) dynamicMod = 1.0f;
2891 #ifdef frictionLoggingC 2892 static int tempDumpFile1 = -1;
2893 if (tempDumpFile1 == -1)
2894 _sopen_s(&tempDumpFile1,
"friction.log", _O_RDWR | _O_CREAT | _O_TRUNC | _O_TEXT | _O_SEQUENTIAL, SH_DENYWR, S_IWRITE);
2900 if (newlocvel.z > 0.0f)
2902 newlocvel.z -= rollfric;
2903 if (newlocvel.z < 0.0f)
2906 else if (newlocvel.z < 0.0f)
2908 newlocvel.z += rollfric;
2909 if (newlocvel.z > 0.0f)
2913 #ifdef frictionLoggingC 2914 if (rollfric != 0.0f)
2917 sprintf_s(
msg, 999,
"%8.3f rol GV%i GR%+i WH%i GE%.1f LB%.1f RB%.1f RFI%.6f RFS%.3f RFG%.3f V%.3f G%.1f R%.1f P%.1f\n",
2918 DXUTGetTime(),
ourcockpit.
gndvehicle ? 1 : 0,
ourcockpit.
gearshift,
ourcockpit.
wheeled ? 1 : 0,
ourcockpit.
gearextent,
viewscreen->
gameclass->
bus->
LeftBrake,
viewscreen->
gameclass->
bus->
RightBrake, rollfric, rollfric / fElapsedTime, rollfric / fElapsedTime *
oneOvergForceKmSSC, newlocvel.z,
gndcontactG,
levelerroll,
levelerpitch);
2919 _write(tempDumpFile1,
msg, strlen(
msg));
2924 if (dynamicMod > 0.0f || max(effectiveLeftBrake, effectiveRightBrake) > 0.0f)
2926 f_temp = slidingFriction * max(dynamicMod, max(effectiveLeftBrake, effectiveRightBrake));
2928 if (newlocvel.z > 0.0f)
2930 newlocvel.z -= f_temp;
2931 if (newlocvel.z < 0.0f)
2934 else if (newlocvel.z < 0.0f)
2936 newlocvel.z += f_temp;
2937 if (newlocvel.z > 0.0f)
2940 #ifdef frictionLoggingC 2944 sprintf_s(
msg, 999,
"%8.3f BRK GV%i GR%+i WH%i GE%.1f LB%.1f RB%.1f SFI%.6f SFS%.3f SFG%.3f V%.3f G%.1f R%.1f P%.1f AVG%.3f\n",
2945 DXUTGetTime(),
ourcockpit.
gndvehicle ? 1 : 0,
ourcockpit.
gearshift,
ourcockpit.
wheeled ? 1 : 0,
ourcockpit.
gearextent, g_fBrakingLeft, g_fBrakingRight, f_temp, f_temp / fElapsedTime, f_temp / fElapsedTime *
oneOvergForceKmSSC, newlocvel.z,
gndcontactG,
levelerroll,
levelerpitch, slidfric / fElapsedTime *
oneOvergForceKmSSC);
2946 _write(tempDumpFile1,
msg, strlen(
msg));
2962 static bool groundscrapeloop =
false;
2963 const float scrapevel = sqrtf(newlocvel.x * newlocvel.x + newlocvel.z * newlocvel.z);
2964 const float scrapevol = min(1.0f, scrapevel / 0.01f *
gndcontactG);
2965 const float rollvol = min(1.0f, fabsf(newlocvel.z) / 0.026f);
2966 if (scrapevol > 0.0f)
2969 groundscrapeloop =
true;
2971 else if (groundscrapeloop)
2973 if (scrapevel > 0.01f)
2976 groundscrapeloop =
false;
2984 D3DXVec3TransformNormal(&cross, &cross, &
playerships[0].matrixWorld);
2992 sprintf_s(
msg,
sizeof(
msg),
"ET: %f", fElapsedTime);
3002 sprintf_s(
msg,
sizeof(
msg),
"cross I: %f", cross.x);
3004 sprintf_s(
msg,
sizeof(
msg),
"cross J: %f", cross.y);
3006 sprintf_s(
msg,
sizeof(
msg),
"cross K: %f", cross.z);
3008 sprintf_s(
msg,
sizeof(
msg),
"newlocvel I: %f", newlocvel.x);
3010 sprintf_s(
msg,
sizeof(
msg),
"newlocvel J: %f", newlocvel.y);
3012 sprintf_s(
msg,
sizeof(
msg),
"newlocvel K: %f", newlocvel.z);
3014 sprintf_s(
msg,
sizeof(
msg),
"slidingFriction: %f", slidingFriction);
3016 sprintf_s(
msg,
sizeof(
msg),
"rollfric: %f", rollfric);
3018 sprintf_s(
msg,
sizeof(
msg),
"rollingResistance: %f", rollingResistance);
3023 sprintf_s(
msg,
sizeof(
msg),
"Trapped a violation with ground friction...");
3046 #pragma region debug 3051 sprintf_s(
msg,
sizeof(
msg),
"ET: %f", fElapsedTime);
3066 sprintf_s(
msg,
sizeof(
msg),
"Trapped a violation after gravityacc application...");
3092 SClientPacketNew outpacket;
3102 if (outpacket.reference < REF_INANOTHER)
3121 outpacket.fuel =
static_cast<unsigned short>(
fuel);
3123 outpacket.pitch1 =
static_cast<short>(
playerships[0].
pitch / rotlimitC * 32767.0f);
3124 outpacket.roll1 =
static_cast<short>(
playerships[0].
roll / rotlimitC * 32767.0f);
3125 outpacket.yaw1 =
static_cast<short>(
playerships[0].
yaw / rotlimitC * 32767.0f);
3181 #pragma region Thrust Sounds 3190 maxVolume += 0.002f;
3224 SPacketBig outpacket;
3225 outpacket.type = 11;
3228 outpacket.array = 0;
3229 outpacket.inarray = 0;
3359 return D3DXVec3Length(&
actual);
float EngineThrustOutput[MAX_ENGINES]
#define oneOvergForceKmSSC
float rollAccelerationSnapshot
float TvmCurrentClosingSpeed
float GetWindDirectionRadians() const
float airframeTempCelsius
D3DXQUATERNION orientation
void Update(float fElapsedTime)
enum Bus::Afcs::LateralModes CurrentLateralMode
void SendToServer(void *pData, DWORD dwSize, bool bGuaranteed, PacketOrdering order=ORDERING_NONE) const
float i48CriticalEngineYawArmM
float i12WingAreaOneSideSqFt
InformationDialog * informationDialog
float yawAccelerationSnapshot
s_network_objects playerships[MAX_SCAN]
float d16HTailWithElevatorSqFt
float WindDirectionDegrees
static float CalculateLiftCoefficient(AirfoilType type, float aoaRad, float CLDelta)
bool ComponentRcsRollFail
float RollAttitudeRadians
float DesiredCourseRadians
float machAngleDragScalar
float pitchAccelerationSnapshot
static void GetFrictionCoefficients(unsigned char type, float *rollingResistance, float *roughness)
void AddCommand(Command command, bool onlyOne)
void SendEvent(EventType eventType, float extent=0.0f) const
float AngleOfAttackRadians
float GlideslopeDeviationRadians
bool ComponentFcsRollFail
D3DXVECTOR3 relativeWindTrueKms
float d17VTailWithRudderSqFt
float engineCriticalAltitude
float DesiredClosingSpeed
bool ThrustReverserCommand[MAX_ENGINES]
float ThrustReverserOutput[MAX_ENGINES]
#define rhoOver2SlugsCuFt2
void LostScannerTarget(const char *msg) const
float DesiredPitchRadians
s_universe_object allobjects[maxstarC]
float GetWindspeedKms() const
float GetTemperatureCelsius() const
bool AssertTelemetry(const char *location, short id)
float IndicatedAirspeedKms
void PrecipWindSoundBarrier(D3DXVECTOR3 relativewind, float elapsedTime)
float Clamp(float val, float min, float max)
std::vector< std::string > sofTracking
float AirframeTemperatureCelsius
float engineEfficiencyAtSeaLevelScalar
float EngineThrustOutput[MAX_ENGINES]
float exteriorInsulationHeatTransferCoefficient
https://en.wikipedia.org/wiki/List_of_thermal_conductivities
float EngineThrustCommand[MAX_ENGINES]
enum Bus::Afcs::VerticalModes CurrentVerticalMode
float l48AverageEnginePitchArmM
const D3DXVECTOR3 centerC
static float CalculateDragCoefficient(AirfoilType type, float aoa, float CDDelta)
float GetAttenuation(bool applyDensity) const
void Log(const char *msg, Level level=Info, int errorCode=0)
enum Bus::Afcs::VerticalModes StandbyVerticalMode
float PitchTrimSurfacePositionDegrees
float Play(int soundEnum)
float DesiredHeadingRadians
D3DXVECTOR3 windVectorTrueKms
float OutsideAirTemperatureKelvin
float Lerp(float val1, float val2, float lerp)
#define maxDragIncreaseApproachingMachC
void SendTelemetry(SClientPacketNew *pData) const
float currentFuelFlowPoundsPerSecond
LOCALGRID2 gridarray[64][64]
void LostVerticalTarget() const
float TotalAirTemperatureCelsius
std::vector< Swaypoint > waypoint
float GetTurbulence() const
float GetTotalThrust() const
short FindByUniqueId(int id) const
void PlayEx(int soundEnum, bool loop, float volume=1.0f, float frequencyMod=1.0f, float pan=0.0f, bool restart=true)
enum Bus::Afcs::LateralModes StandbyLateralMode
float GetTurbidity() const
void AddToCallStack(const char *msg)
float f20FrontBackDragCoeff
D3DXVECTOR3 oldOdoPosition
float StaticAirTemperatureCelsius
float PitchAttitudeRadians
float EngineThrustLever[MAX_ENGINES]
#define ZeroCelsiusToKelvin
propulsion(Viewscreen *ptr)