]> git.mxchange.org Git - flightgear.git/commitdiff
Maik: add a downwashfactor tunable
authorandy <andy>
Mon, 23 Jul 2007 16:10:21 +0000 (16:10 +0000)
committerandy <andy>
Mon, 23 Jul 2007 16:10:21 +0000 (16:10 +0000)
src/FDM/YASim/FGFDM.cpp
src/FDM/YASim/Rotor.cpp
src/FDM/YASim/Rotor.hpp

index 53a59707eb3fe45e3d0b89f1f34a9007ed0c9474..b0a5be51df1e1245fb07c244bd95477b2dc2edc1 100644 (file)
@@ -728,6 +728,7 @@ Rotor* FGFDM::parseRotor(XMLAttributes* a, const char* type)
     w->setTiltCenterX(attrf(a,"tiltcenterx",0.0));
     w->setTiltCenterY(attrf(a,"tiltcentery",0.0));
     w->setTiltCenterZ(attrf(a,"tiltcenterz",0.0));
+    w->setDownwashFactor(attrf(a, "downwashfactor", 1));
     if(attrb(a,"ccw"))
        w->setCcw(1); 
     if(attrb(a,"sharedflaphinge"))
index 9031c3e6c99a6c6631916d0254fff8e25e15cf8e..6bb69ca49a47600ac22126cfe3b693afd9db49ca 100644 (file)
@@ -150,6 +150,7 @@ Rotor::Rotor()
     _max_tilt_yaw=0;
     _max_tilt_pitch=0;
     _max_tilt_roll=0;
+    _downwash_factor=1;
 }
 
 Rotor::~Rotor()
@@ -652,6 +653,11 @@ void Rotor::setRelLenHinge(float value)
     _rel_len_hinge=value;
 }
 
+void Rotor::setDownwashFactor(float value)
+{
+    _downwash_factor=value;
+}
+
 void Rotor::setAlphaoutput(int i, const char *text)
 {
     strncpy(_alphaoutput[i],text,255);
@@ -1019,7 +1025,7 @@ void Rotor::getDownWash(float *pos, float *v_heli, float *downwash)
     //at dist = rotor radius it is assumed to be 1/e * v1 + (1-1/e)* v2
 
     float v = g * v1 + (1-g) * v2;
-    Math::mul3(-v,_normal_with_yaw_roll,downwash);
+    Math::mul3(-v*_downwash_factor,_normal_with_yaw_roll,downwash);
     //the downwash is calculated in the opposite direction of the normal
 }
 
index 03d2be4cd4a1ee4507521f29527d3e55e288168b..5bec0a43f82c0d43015f6eb642aebf97b1b9080a 100644 (file)
@@ -39,6 +39,7 @@ private:
     float _old_tilt_roll;
     float _old_tilt_pitch;
     float _old_tilt_yaw;
+    float _downwash_factor;
 
 public:
     Rotor();
@@ -107,6 +108,7 @@ public:
     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();