1
0
Fork 0

YASim Airplane: add initalizers.

This commit is contained in:
Henning Stahlke 2017-04-24 18:31:03 +02:00
parent 8bd8d5f163
commit ed6dee3f55
2 changed files with 26 additions and 46 deletions

View file

@ -33,26 +33,6 @@ const float SOLVE_TWEAK = 0.3226;
Airplane::Airplane() Airplane::Airplane()
{ {
_emptyWeight = 0;
_pilotPos[0] = _pilotPos[1] = _pilotPos[2] = 0;
_wing = 0;
_tail = 0;
_ballast = 0;
_cruiseSpeed = 0;
_cruiseWeight = 0;
_cruiseGlideAngle = 0;
_approachSpeed = 0;
_approachAoA = 0;
_approachWeight = 0;
_approachGlideAngle = 0;
_dragFactor = 1;
_liftRatio = 1;
_cruiseAoA = 0;
_tailIncidence = 0;
_failureMsg = 0;
_wingsN = 0;
} }
Airplane::~Airplane() Airplane::~Airplane()

View file

@ -148,17 +148,17 @@ private:
Model _model; Model _model;
ControlMap _controls; ControlMap _controls;
float _emptyWeight; float _emptyWeight {0};
float _pilotPos[3]; float _pilotPos[3] {0, 0, 0};
Wing* _wing; Wing* _wing {nullptr};
Wing* _tail; Wing* _tail {nullptr};
Vector _fuselages; Vector _fuselages;
Vector _vstabs; Vector _vstabs;
Vector _tanks; Vector _tanks;
Vector _thrusters; Vector _thrusters;
float _ballast; float _ballast {0};
Vector _gears; Vector _gears;
Vector _contacts; // non-gear ground contact points Vector _contacts; // non-gear ground contact points
@ -171,34 +171,34 @@ private:
Vector _cruiseControls; Vector _cruiseControls;
State _cruiseState; State _cruiseState;
Atmosphere _cruiseAtmo; Atmosphere _cruiseAtmo;
float _cruiseSpeed; float _cruiseSpeed{0};
float _cruiseWeight; float _cruiseWeight{0};
float _cruiseFuel; float _cruiseFuel{0};
float _cruiseGlideAngle; float _cruiseGlideAngle{0};
Vector _approachControls; Vector _approachControls;
State _approachState; State _approachState;
Atmosphere _approachAtmo; Atmosphere _approachAtmo;
float _approachSpeed; float _approachSpeed {0};
float _approachAoA; float _approachAoA {0};
float _approachWeight; float _approachWeight {0};
float _approachFuel; float _approachFuel {0};
float _approachGlideAngle; float _approachGlideAngle {0};
int _solutionIterations; int _solutionIterations {0};
float _dragFactor; float _dragFactor {1};
float _liftRatio; float _liftRatio {1};
float _cruiseAoA; float _cruiseAoA {0};
float _tailIncidence; float _tailIncidence {0};
Control _approachElevator; Control _approachElevator;
const char* _failureMsg; const char* _failureMsg {0};
float _cgMax = -1e6; // hard limits for cg from gear position float _cgMax {-1e6}; // hard limits for cg from gear position
float _cgMin = 1e6; // hard limits for cg from gear position float _cgMin {1e6}; // hard limits for cg from gear position
float _cgDesiredMax = 0.3f; // desired cg max in %MAC from config float _cgDesiredMax {0.3f}; // desired cg max in %MAC from config
float _cgDesiredMin = 0.25f; // desired cg min in %MAC from config float _cgDesiredMin {0.25f}; // desired cg min in %MAC from config
float _cgDesiredFront; // calculated desired cg x max float _cgDesiredFront {0}; // calculated desired cg x max
float _cgDesiredAft; // calculated desired cg x min float _cgDesiredAft {0}; // calculated desired cg x min
bool _autoBallast = false; bool _autoBallast = false;
}; };