]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/YASim/Rotor.hpp
Port over remaining Point3D usage to the more type and unit safe SG* classes.
[flightgear.git] / src / FDM / YASim / Rotor.hpp
index 1b326415e6b8281a34841b36c3338999e8ff7362..43ea60e04474b593837f807a9a08e843476c5d36 100644 (file)
@@ -31,6 +31,15 @@ private:
     int _number_of_blades;
     int _number_of_segments;
     int _number_of_parts;
+    float _balance1;
+    float _balance2;
+    float _tilt_yaw;
+    float _tilt_roll;
+    float _tilt_pitch;
+    float _old_tilt_roll;
+    float _old_tilt_pitch;
+    float _old_tilt_yaw;
+    float _downwash_factor;
 
 public:
     Rotor();
@@ -54,6 +63,18 @@ public:
     void setMaxCyclicele(float value);
     void setMaxCollective(float value);
     void setMinCollective(float value);
+    void setMinTiltYaw(float value);
+    void setMinTiltPitch(float value);
+    void setMinTiltRoll(float value);
+    void setMaxTiltYaw(float value);
+    void setMaxTiltPitch(float value);
+    void setMaxTiltRoll(float value);
+    void setTiltCenterX(float value);
+    void setTiltCenterY(float value);
+    void setTiltCenterZ(float value);
+    void setTiltYaw(float lval);
+    void setTiltPitch(float lval);
+    void setTiltRoll(float lval);
     void setDiameter(float value);
     void setWeightPerBlade(float value);
     void setNumberOfBlades(float value);
@@ -72,20 +93,23 @@ public:
     void setCyclicail(float lval,float rval);
     void setCyclicele(float lval,float rval);
     void setCollective(float lval);
+    void setRotorBalance(float lval);
     void setAlphaoutput(int i, const char *text);
     void setCcw(int ccw);
     int getCcw() {return _ccw;};
-    void setParameter(char *parametername, float value);
+    void setParameter(const char *parametername, float value);
     void setGlobalGround(double* global_ground, float* global_vel);
     float getTorqueOfInertia();
     int getValueforFGSet(int j,char *b,float *f);
     void setName(const char *text);
     void inititeration(float dt,float omegarel,float ddt_omegarel,float *rot);
     void compile();
+    void updateDirectionsAndPositions(float *rot);
     void getTip(float* tip);
     void calcLiftFactor(float* v, float rho, State *s);
     void getDownWash(float *pos, float * v_heli, float *downwash);
     int getNumberOfBlades(){return _number_of_blades;}
+    void setDownwashFactor(float value);
 
     // Query the list of Rotorpart objects
     int numRotorparts();
@@ -118,19 +142,26 @@ public:
     float *getGravDirection() {return _grav_direction;}
     void writeInfo();
     void setSharedFlapHinge(bool s);
+    void setBalance(float b);
+    float getBalance(){ return (_balance1>0)?_balance1*_balance2:_balance1;}
 
 private:
+    void testForRotorGroundContact (Ground * ground_cb,State *s);
     void strncpy(char *dest,const char *src,int maxlen);
     void interp(float* v1, float* v2, float frac, float* out);
     float calcStall(float incidence,float speed);
     float findGroundEffectAltitude(Ground * ground_cb,State *s,
         float *pos0,float *pos1,float *pos2,float *pos3,
         int iteration=0,float a0=-1,float a1=-1,float a2=-1,float a3=-1);
-    Rotorpart* newRotorpart(float* pos, float *posforceattac, float *normal,
-        float* speed,float *dirzentforce, float zentforce,float maxpitchforce,
+    static void euler2orient(float roll, float pitch, float hdg,
+                             float* out);
+    Rotorpart* newRotorpart(/*float* pos, float *posforceattac, float *normal,
+        float* speed,float *dirzentforce, */float zentforce,float maxpitchforce,
         float delta3,float mass,float translift,float rellenhinge,float len);
     float _base[3];
     float _groundeffectpos[4][3];
+    float _ground_contact_pos[16][3];
+    int _num_ground_contact_pos;
     float _ground_effect_altitude;
     //some postions, where to calcualte the ground effect
     float _normal[3];//the normal vector (direction of rotormast, pointing up)
@@ -139,6 +170,13 @@ private:
     float _diameter;
     float _weight_per_blade;
     float _rel_blade_center;
+    float _tilt_center[3];
+    float _min_tilt_yaw;
+    float _min_tilt_pitch;
+    float _min_tilt_roll;
+    float _max_tilt_yaw;
+    float _max_tilt_pitch;
+    float _max_tilt_roll;
     float _min_pitch;
     float _max_pitch;
     float _force_at_pitch_a;
@@ -202,6 +240,8 @@ private:
     float _phi;
     bool _shared_flap_hinge;
     float _grav_direction[3];
+    int _properties_tied;
+    bool _directions_and_postions_dirty;
 };
 std::ostream &  operator<<(std::ostream & out, /*const*/ Rotor& r);
 
@@ -220,6 +260,8 @@ private:
     float _engine_accel_limit;
     float _total_torque_on_engine;
     Vector _rotors;
+    float _target_rel_rpm;
+    float _max_rel_torque;
 
 public:
     Rotorgear();
@@ -235,6 +277,8 @@ public:
     void setEngineOn(int value);
     int getEngineon();
     void setRotorBrake(float lval);
+    void setRotorEngineMaxRelTorque(float lval);
+    void setRotorRelTarget(float lval);
     float getYasimDragFactor() { return _yasimdragfactor;}
     float getYasimLiftFactor() { return _yasimliftfactor;}
     float getMaxPowerEngine() { return _max_power_engine;}