From f9334d8c394c764ece677a6588d71c816ce9d0ad Mon Sep 17 00:00:00 2001 From: Henning Stahlke Date: Sat, 29 Apr 2017 01:57:21 +0200 Subject: [PATCH] YASim Surface move initialization --- src/FDM/YASim/Surface.cpp | 25 +------------------- src/FDM/YASim/Surface.hpp | 48 +++++++++++++++++++-------------------- 2 files changed, 25 insertions(+), 48 deletions(-) diff --git a/src/FDM/YASim/Surface.cpp b/src/FDM/YASim/Surface.cpp index 475c9ec90..6f01dc836 100644 --- a/src/FDM/YASim/Surface.cpp +++ b/src/FDM/YASim/Surface.cpp @@ -7,35 +7,12 @@ int Surface::s_idGenerator = 0; Surface::Surface( Version * version ) : _version(version) { - // create id for surface _id = s_idGenerator++; - // Start in a "sane" mode, so unset stuff doesn't freak us out - _c0 = 1; - _cx = _cy = _cz = 1; - _cz0 = 0; - _peaks[0] = _peaks[1] = 1; - int i; - for(i=0; i<4; i++) { - _stalls[i] = 0; - _widths[i] = 0.01; // half a degree - } + _orient[0] = 1; _orient[1] = 0; _orient[2] = 0; _orient[3] = 0; _orient[4] = 1; _orient[5] = 0; _orient[6] = 0; _orient[7] = 0; _orient[8] = 1; - _chord = 0; - _incidence = 0; - _twist = 0; - _slatPos = _spoilerPos = _flapPos = 0; - _slatDrag = _spoilerDrag = _flapDrag = 1; - - _flapLift = 0; - _flapEffectiveness = 1; - _slatAlpha = 0; - _spoilerLift = 1; - _inducedDrag = 1; - _stallAlpha = 0; - _alpha = 0; _surfN = fgGetNode("/fdm/yasim/debug/surfaces", true); if (_surfN != 0) { _surfN = _surfN->getChild("surface", _id, true); diff --git a/src/FDM/YASim/Surface.hpp b/src/FDM/YASim/Surface.hpp index f65890cfe..6114dc26f 100644 --- a/src/FDM/YASim/Surface.hpp +++ b/src/FDM/YASim/Surface.hpp @@ -92,36 +92,36 @@ private: float flapLift(float alpha); float controlDrag(float lift, float drag); - float _chord; // X-axis size - float _c0; // total force coefficient - float _cx; // X-axis force coefficient - float _cy; // Y-axis force coefficient - float _cz; // Z-axis force coefficient - float _cz0; // Z-axis force offset - float _peaks[2]; // Stall peak coefficients (fwd, back) - float _stalls[4]; // Stall angles (fwd/back, pos/neg) - float _widths[4]; // Stall widths " " + float _chord {0}; // X-axis size + float _c0 {1}; // total force coefficient + float _cx {1}; // X-axis force coefficient + float _cy {1}; // Y-axis force coefficient + float _cz {1}; // Z-axis force coefficient + float _cz0 {0}; // Z-axis force offset + float _peaks[2] {1, 1}; // Stall peak coefficients (fwd, back) + float _stalls[4] {0, 0, 0, 0}; // Stall angles (fwd/back, pos/neg) + float _widths[4] {0.01, 0.01, 0.01, 0.01}; // Stall widths " " float _pos[3]; // position in local coords float _orient[9]; // local->surface orthonormal matrix - float _slatAlpha; - float _slatDrag; - float _flapLift; - float _flapDrag; - float _flapEffectiveness; - float _spoilerLift; - float _spoilerDrag; + float _slatAlpha {0}; + float _slatDrag {1}; + float _flapLift {0}; + float _flapDrag {1}; + float _flapEffectiveness {1}; + float _spoilerLift {1}; + float _spoilerDrag {1}; - float _slatPos; - float _flapPos; - float _spoilerPos; - float _incidence; - float _twist; - float _inducedDrag; + float _slatPos {0}; + float _flapPos {0}; + float _spoilerPos {0}; + float _incidence {0}; + float _twist {0}; + float _inducedDrag {1}; // used during calculations - float _stallAlpha; - float _alpha; + float _stallAlpha {0}; + float _alpha {0}; Version * _version; SGPropertyNode* _fxN;