1
0
Fork 0

YASIM add method multiplyLiftRatio to class Wing

This commit is contained in:
Henning Stahlke 2017-11-26 22:28:30 +01:00
parent 6feca92060
commit 3809137f7d
3 changed files with 9 additions and 4 deletions

View file

@ -815,13 +815,13 @@ void Airplane::applyLiftRatio(float factor)
float applied = Math::pow(factor, SOLVE_TWEAK);
_liftRatio *= applied;
if(_wing)
_wing->setLiftRatio(_wing->getLiftRatio() * applied);
_wing->multiplyLiftRatio(applied);
if(_tail)
_tail->setLiftRatio(_tail->getLiftRatio() * applied);
_tail->multiplyLiftRatio(applied);
int i;
for(i=0; i<_vstabs.size(); i++) {
Wing* w = (Wing*)_vstabs.get(i);
w->setLiftRatio(w->getLiftRatio() * applied);
w->multiplyLiftRatio(applied);
}
}

View file

@ -256,6 +256,11 @@ void Wing::compile()
writeInfoToProptree();
}
void Wing::multiplyLiftRatio(float factor)
{
setLiftRatio(_liftRatio * factor);
}
void Wing::addSurface(Surface* s, float weight, float twist)
{
SurfRec *sr = new SurfRec();

View file

@ -109,7 +109,7 @@ public:
// The ratio of force along the Z (lift) direction of each wing
// segment to that along the X (drag) direction.
void setLiftRatio(float ratio);
float getLiftRatio() const { return _liftRatio; }
void multiplyLiftRatio(float factor);
void setPropertyNode(SGPropertyNode_ptr n) { _wingN = n; };
float updateModel(Model* model);