]> git.mxchange.org Git - flightgear.git/blob - src/FDM/YASim/Rotor.hpp
Fix a typo which Frederic's compiler flagged.
[flightgear.git] / src / FDM / YASim / Rotor.hpp
1 #ifndef _ROTOR_HPP
2 #define _ROTOR_HPP
3
4 #include "Vector.hpp"
5 #include "Rotorpart.hpp"
6 #include "Rotorblade.hpp"
7 namespace yasim {
8
9 class Surface;
10 class Rotorpart;
11
12 class Rotor {
13 public:
14     Rotor();
15     ~Rotor();
16
17
18     // Rotor geometry:
19     void setNormal(float* normal);    //the normal vector (direction of rotormast, pointing up)
20     void setForward(float* forward);    //the normal vector pointing forward (for ele and ail)
21     //void setMaxPitchForce(float force);
22     void setForceAtPitchA(float force);
23     void setPowerAtPitch0(float value);
24     void setPowerAtPitchB(float value);
25     void setNotorque(int value);
26     void setPitchA(float value);
27     void setPitchB(float value);
28     void setMinCyclicail(float value);
29     void setMinCyclicele(float value);
30     void setMaxCyclicail(float value);
31     void setMaxCyclicele(float value);
32     void setMaxCollective(float value);
33     void setMinCollective(float value);
34     void setDiameter(float value);
35     void setWeightPerBlade(float value);
36     void setNumberOfBlades(float value);
37     void setRelBladeCenter(float value);
38     void setDelta3(float value);
39     void setDelta(float value);
40     void setDynamic(float value);
41     void setTranslift(float value);
42     void setC2(float value);
43     void setStepspersecond(float steps);
44     void setRPM(float value);
45     void setRelLenHinge(float value);
46     void setBase(float* base);        // in local coordinates
47     void setCyclicail(float lval,float rval);
48     void setCyclicele(float lval,float rval);
49     void setCollective(float lval);
50     void setAlphaoutput(int i, const char *text);
51     void setCcw(int ccw);
52     void setSimBlades(int value);
53     void setEngineOn(int value);
54
55     int getValueforFGSet(int j,char *b,float *f);
56     void setName(const char *text);
57     void inititeration(float dt);
58     void compile();
59
60     void getTip(float* tip);
61
62
63
64     // Ground effect information, stil missing
65     float getGroundEffect(float* posOut);
66     
67     // Query the list of Rotorpart objects
68     int numRotorparts();
69     Rotorpart* getRotorpart(int n);
70     // Query the list of Rotorblade objects
71     int numRotorblades();
72     Rotorblade* getRotorblade(int n);
73     void setAlpha0(float f);
74     void setAlphamin(float f);
75     void setAlphamax(float f);
76     void setTeeterdamp(float f);
77     void setMaxteeterdamp(float f);
78     void setRelLenTeeterHinge(float value);
79     void setAlpha0factor(float f);
80
81 private:
82     void strncpy(char *dest,const char *src,int maxlen);
83     void interp(float* v1, float* v2, float frac, float* out);
84     Rotorpart* newRotorpart(float* pos, float *posforceattac, float *normal,
85          float* speed,float *dirzentforce, float zentforce,float maxpitchforce,float maxpitch, float minpitch, float mincyclic,float maxcyclic,
86          float delta3,float mass,float translift,float rellenhinge,float len);
87
88     Rotorblade* newRotorblade(
89          float* pos,  float *normal,float *front, float *right,
90          float lforceattac,float relenhinge,
91          float *dirzentforce, float zentforce,float maxpitchforce,float maxpitch, 
92          float delta3,float mass,float translift,float phi,float omega,float len,float speed);
93     
94
95
96     Vector _rotorparts;
97     Vector _rotorblades;
98
99     float _base[3];
100
101     float _normal[3];//the normal vector (direction of rotormast, pointing up)
102     float _forward[3];
103     float _diameter;
104     int _number_of_blades;
105     float _weight_per_blade;
106     float _rel_blade_center;
107     float _min_pitch;
108     float _max_pitch;
109     float _force_at_max_pitch;
110     float _force_at_pitch_a;
111     float _pitch_a;
112     float _power_at_pitch_0;
113     float _power_at_pitch_b;
114     int _no_torque;
115     int _sim_blades;
116     float _pitch_b;
117     float _rotor_rpm;
118     float _rel_len_hinge;
119     float _maxcyclicail;
120     float _maxcyclicele;
121     float _mincyclicail;
122     float _mincyclicele;
123     float _delta3;
124     float _delta;
125     float _dynamic;
126     float _translift;
127     float _c2;
128     float _stepspersecond;
129     char _alphaoutput[8][256];
130     char _name[256];
131     int _ccw;
132     int _engineon;
133     float _omega,_omegan,_omegarel;
134     float _alphamin,_alphamax,_alpha0,_alpha0factor;
135     float _teeterdamp,_maxteeterdamp;
136     float _rellenteeterhinge;
137
138
139
140
141
142
143 };
144
145 }; // namespace yasim
146 #endif // _ROTOR_HPP