]> git.mxchange.org Git - flightgear.git/blob - src/FDM/YASim/Rotorblade.hpp
Initial revision.
[flightgear.git] / src / FDM / YASim / Rotorblade.hpp
1 #ifndef _ROTORBLADE_HPP
2 #define _ROTORBLADE_HPP
3
4 namespace yasim {
5
6 class Rotorblade
7 {
8 public:
9     Rotorblade();
10
11     // Position of this surface in local coords
12     void setPosition(float* p);
13     void getPosition(float* out);
14     float getPhi();
15     void setPhi(float value);
16
17     void setPositionForceAttac(float* p);
18     void getPositionForceAttac(float* out);
19
20     void setNormal(float* p);
21     void setFront(float* p);
22     void setRight(float* p);
23     void getNormal(float* out);
24
25     void setMaxPitchForce(float force);
26
27     void setCollective(float pos);
28
29     void setCyclicele(float pos);
30     void setCyclicail(float pos);
31
32     void setOmega(float value);
33     void setOmegaN(float value);
34     void setLen(float value);
35     void setLenHinge(float value);
36     void setLforceattac(float value);
37
38     void setSpeed(float p);
39     void setDirectionofZentipetalforce(float* p);
40     void setZentipetalForce(float f);
41     void setMaxpitch(float f);
42     void setDelta3(float f);
43     void setDelta(float f);
44     void setDeltaPhi(float f);
45     void setDynamic(float f);
46     void setTranslift(float f);
47     void setC2(float f);
48     void setStepspersecond(float steps);
49     void setZentForce(float f);
50
51     float getAlpha(int i);
52     float getrealAlpha(void);
53     char* getAlphaoutput(int i);
54     void setAlphaoutput(char *text,int i);
55
56     void inititeration(float dt,float *rot);
57     
58     float getWeight(void);
59     void setWeight(float value);
60
61     float getFlapatPos(int k);
62
63
64
65
66
67
68
69     // local -> Rotorblade coords
70     //void setOrientation(float* o);
71
72
73     void calcForce(float* v, float rho, float* forceOut, float* torqueOut);
74     void setlastnextrp(Rotorblade*lastrp,Rotorblade*nextrp,Rotorblade *oppositerp);
75     void setTorque(float torque_max_force,float torque_no_force);
76     void calcFrontRight();
77     float getIncidence();
78     void setAlpha0(float f);
79     void setAlphamin(float f);
80     void setAlphamax(float f);
81     void setAlpha0factor(float f);
82     void setTeeterdamp(float f);
83     void setMaxteeterdamp(float f);
84     void setRelLenTeeterHinge(float value);
85
86 private:
87     void strncpy(char *dest,const char *src,int maxlen);
88     Rotorblade *_lastrp,*_nextrp,*_oppositerp;
89
90     float _dt;
91     float _phi,_omega,_omegan;
92     float _delta;
93     float _deltaphi;
94     int _first;
95     
96     float _len;
97     float _lforceattac;
98     float _pos[3];    // position in local coords
99     float _posforceattac[3];    // position in local coords
100     float _normal[3]; //direcetion of the rotation axis
101     float _front[3],_right[3];
102     float _lright[3],_lfront[3];
103     float _torque_max_force;
104     float _torque_no_force;
105     float _speed;
106     float _directionofzentipetalforce[3];
107     float _zentipetalforce;
108     float _maxpitch;
109     float _maxpitchforce;
110     float _cyclicele;
111     float _cyclicail;
112     float _collective;
113     float _delta3;
114     float _dynamic;
115     float _flapatpos[4];//flapangle at 0, 90, 180 and 270 degree, for graphics
116     float _translift;
117     float _c2;
118     float _mass;
119     float _alpha;
120     float _alphaalt;
121     float _alphaomega;
122     float _rellenhinge;
123     float _incidence;
124     float _alphamin,_alphamax,_alpha0,_alpha0factor;
125     float _stepspersecond;
126     float _teeter,_ddtteeter;
127     float _teeterdamp,_maxteeterdamp;
128     float _rellenteeterhinge;
129
130
131
132           
133     char _alphaoutputbuf[2][256];
134     int _alpha2type;
135
136     //float _orient[9]; // local->surface orthonormal matrix
137
138     bool  _calcforcesdone;
139     float _oldt[3],_oldf[3];
140
141     float _showa,_showb;
142
143 };
144
145 }; // namespace yasim
146 #endif // _ROTORBLADE_HPP