1
0
Fork 0

Maik: add a downwashfactor tunable

This commit is contained in:
andy 2007-07-23 16:10:21 +00:00
parent a5548068dc
commit 0368accc6d
3 changed files with 10 additions and 1 deletions

View 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"))

View 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
}

View 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();