1
0
Fork 0

YASim method name clarification in class Surface

This commit is contained in:
Henning Stahlke 2017-02-02 09:55:45 +01:00
parent 91fd075796
commit 97a0511ce0
3 changed files with 16 additions and 16 deletions

View file

@ -134,7 +134,7 @@ void Surface::setSpoilerParams(float liftPenalty, float dragPenalty)
_spoilerDrag = dragPenalty;
}
void Surface::setFlap(float pos)
void Surface::setFlapPos(float pos)
{
_flapPos = pos;
}
@ -150,12 +150,12 @@ double Surface::getFlapEffectiveness()
}
void Surface::setSlat(float pos)
void Surface::setSlatPos(float pos)
{
_slatPos = pos;
}
void Surface::setSpoiler(float pos)
void Surface::setSpoilerPos(float pos)
{
_spoilerPos = pos;
}
@ -257,9 +257,9 @@ void Surface::test()
float rho = Atmosphere::getStdDensity(0);
float spd = 30;
setFlap(0);
setSlat(0);
setSpoiler(0);
setFlapPos(0);
setSlatPos(0);
setSpoilerPos(0);
for(float angle = -90; angle<90; angle += 0.01) {
float rad = angle * DEG2RAD;

View file

@ -32,9 +32,9 @@ public:
// Positions for the controls, in the range [0:1]. [-1:1] for
// flaps, with positive meaning "force goes towards positive Z"
void setFlap(float pos);
void setSlat(float pos);
void setSpoiler(float pos);
void setFlapPos(float pos);
void setSlatPos(float pos);
void setSpoilerPos(float pos);
// Modifier for flap lift coefficient, useful for simulating flap blowing etc.
void setFlapEffectiveness(float effectiveness);

View file

@ -173,8 +173,8 @@ void Wing::setFlap0Pos(float lval, float rval)
rval = Math::clamp(rval, -1, 1);
int i;
for(i=0; i<_flap0Surfs.size(); i++) {
((Surface*)_flap0Surfs.get(i))->setFlap(lval);
if(_mirror) ((Surface*)_flap0Surfs.get(++i))->setFlap(rval);
((Surface*)_flap0Surfs.get(i))->setFlapPos(lval);
if(_mirror) ((Surface*)_flap0Surfs.get(++i))->setFlapPos(rval);
}
}
@ -194,8 +194,8 @@ void Wing::setFlap1Pos(float lval, float rval)
rval = Math::clamp(rval, -1, 1);
int i;
for(i=0; i<_flap1Surfs.size(); i++) {
((Surface*)_flap1Surfs.get(i))->setFlap(lval);
if(_mirror) ((Surface*)_flap1Surfs.get(++i))->setFlap(rval);
((Surface*)_flap1Surfs.get(i))->setFlapPos(lval);
if(_mirror) ((Surface*)_flap1Surfs.get(++i))->setFlapPos(rval);
}
}
@ -215,8 +215,8 @@ void Wing::setSpoilerPos(float lval, float rval)
rval = Math::clamp(rval, 0, 1);
int i;
for(i=0; i<_spoilerSurfs.size(); i++) {
((Surface*)_spoilerSurfs.get(i))->setSpoiler(lval);
if(_mirror) ((Surface*)_spoilerSurfs.get(++i))->setSpoiler(rval);
((Surface*)_spoilerSurfs.get(i))->setSpoilerPos(lval);
if(_mirror) ((Surface*)_spoilerSurfs.get(++i))->setSpoilerPos(rval);
}
}
@ -225,7 +225,7 @@ void Wing::setSlatPos(float val)
val = Math::clamp(val, 0, 1);
int i;
for(i=0; i<_slatSurfs.size(); i++)
((Surface*)_slatSurfs.get(i))->setSlat(val);
((Surface*)_slatSurfs.get(i))->setSlatPos(val);
}
float Wing::getGroundEffect(float* posOut)