1
0
Fork 0

YASim: add initalizer to Wing.hpp, cleanup constructor.

This commit is contained in:
Henning Stahlke 2017-04-29 12:42:59 +02:00
parent b4743b3830
commit 37c43ab6dc
2 changed files with 43 additions and 79 deletions

View file

@ -7,47 +7,12 @@ static const float RAD2DEG = 57.2957795131;
Wing::Wing( Version * version ) : Wing::Wing( Version * version ) :
_version(version) _version(version)
{ {
_mirror = false;
_base[0] = _base[1] = _base[2] = 0;
_length = 0;
_chord = 0;
_taper = 0;
_sweep = 0;
_dihedral = 0;
_stall = 0;
_stallWidth = 0;
_stallPeak = 0;
_twist = 0;
_camber = 0;
_incidence = 0;
_inducedDrag = 1;
_dragScale = 1;
_liftRatio = 1;
_flap0Start = 0;
_flap0End = 0;
_flap0Lift = 0;
_flap0Drag = 0;
_flap1Start = 0;
_flap1End = 0;
_flap1Lift = 0;
_flap1Drag = 0;
_spoilerStart = 0;
_spoilerEnd = 0;
_spoilerLift = 0;
_spoilerDrag = 0;
_slatStart = 0;
_slatEnd = 0;
_slatAoA = 0;
_slatDrag = 0;
_meanChord = 0;
_wingspan = 0;
_aspectRatio = 1;
} }
Wing::~Wing() Wing::~Wing()
{ {
int i; for(int i=0; i<_surfs.size(); i++) {
for(i=0; i<_surfs.size(); i++) {
SurfRec* s = (SurfRec*)_surfs.get(i); SurfRec* s = (SurfRec*)_surfs.get(i);
delete s->surface; delete s->surface;
delete s; delete s;
@ -57,8 +22,7 @@ Wing::~Wing()
void Wing::setIncidence(float incidence) void Wing::setIncidence(float incidence)
{ {
_incidence = incidence; _incidence = incidence;
int i; for(int i=0; i<_surfs.size(); i++)
for(i=0; i<_surfs.size(); i++)
((SurfRec*)_surfs.get(i))->surface->setIncidence(incidence); ((SurfRec*)_surfs.get(i))->surface->setIncidence(incidence);
} }

View file

@ -106,55 +106,55 @@ private:
Vector _slatSurfs; Vector _slatSurfs;
Vector _spoilerSurfs; Vector _spoilerSurfs;
bool _mirror; bool _mirror {false};
float _base[3]; float _base[3] {0,0,0};
float _length; float _length {0};
float _chord; float _chord {0};
float _taper; float _taper {1};
float _sweep; float _sweep {0};
float _dihedral; float _dihedral {0};
// calculated from above // calculated from above
float _tip[3]; float _tip[3] {0,0,0};
float _meanChord; // std. mean chord float _meanChord {0}; // std. mean chord
float _mac; // mean aerodynamic chord length float _mac {0}; // mean aerodynamic chord length
float _macRootDistance; // y-distance of mac from root float _macRootDistance {0}; // y-distance of mac from root
float _macX; // x-coordinate of mac (leading edge) float _macX {0}; // x-coordinate of mac (leading edge)
float _netSpan; float _netSpan {0};
float _wingspan; float _wingspan {0};
float _aspectRatio; float _aspectRatio {1};
float _stall; float _stall {0};
float _stallWidth; float _stallWidth {0};
float _stallPeak; float _stallPeak {0};
float _twist; float _twist {0};
float _camber; float _camber {0};
float _incidence; float _incidence {0};
float _inducedDrag; float _inducedDrag {1};
float _dragScale; float _dragScale {1};
float _liftRatio; float _liftRatio {1};
float _flap0Start; float _flap0Start {0};
float _flap0End; float _flap0End {0};
float _flap0Lift; float _flap0Lift {0};
float _flap0Drag; float _flap0Drag {0};
float _flap1Start; float _flap1Start {0};
float _flap1End; float _flap1End {0};
float _flap1Lift; float _flap1Lift {0};
float _flap1Drag; float _flap1Drag {0};
float _spoilerStart; float _spoilerStart {0};
float _spoilerEnd; float _spoilerEnd {0};
float _spoilerLift; float _spoilerLift {0};
float _spoilerDrag; float _spoilerDrag {0};
float _slatStart; float _slatStart {0};
float _slatEnd; float _slatEnd {0};
float _slatAoA; float _slatAoA {0};
float _slatDrag; float _slatDrag {0};
Version * _version; Version * _version;
}; };