YASIM: method name clarification (and indention)
This commit is contained in:
parent
0e6552cddf
commit
fb6f965db7
4 changed files with 33 additions and 28 deletions
|
@ -787,35 +787,35 @@ void Airplane::applyDragFactor(float factor)
|
|||
float applied = Math::pow(factor, SOLVE_TWEAK);
|
||||
_dragFactor *= applied;
|
||||
if(_wing)
|
||||
_wing->setDragScale(_wing->getDragScale() * applied);
|
||||
_wing->multiplyDragCoefficient(applied);
|
||||
if(_tail)
|
||||
_tail->setDragScale(_tail->getDragScale() * applied);
|
||||
_tail->multiplyDragCoefficient(applied);
|
||||
int i;
|
||||
for(i=0; i<_vstabs.size(); i++) {
|
||||
Wing* w = (Wing*)_vstabs.get(i);
|
||||
w->setDragScale(w->getDragScale() * applied);
|
||||
Wing* w = (Wing*)_vstabs.get(i);
|
||||
w->multiplyDragCoefficient(applied);
|
||||
}
|
||||
for(i=0; i<_fuselages.size(); i++) {
|
||||
Fuselage* f = (Fuselage*)_fuselages.get(i);
|
||||
int j;
|
||||
for(j=0; j<f->surfs.size(); j++) {
|
||||
Surface* s = (Surface*)f->surfs.get(j);
|
||||
if( isVersionOrNewer( YASIM_VERSION_32 ) ) {
|
||||
// For new YASim, the solver drag factor is only applied to
|
||||
// the X axis for Fuselage Surfaces.
|
||||
// The solver is tuning the coefficient for longitudinal drag,
|
||||
// along the direction of flight. A fuselage's lateral drag
|
||||
// is completely independent and is normally much higher;
|
||||
// it won't be affected by the streamlining done to reduce
|
||||
// longitudinal drag. So the solver should only adjust the
|
||||
// fuselage's longitudinal (X axis) drag coefficient.
|
||||
s->setXDrag(s->getXDrag() * applied);
|
||||
} else {
|
||||
// Originally YASim applied the drag factor to all axes
|
||||
// for Fuselage Surfaces.
|
||||
s->setDragCoefficient(s->getDragCoefficient() * applied);
|
||||
}
|
||||
}
|
||||
Fuselage* f = (Fuselage*)_fuselages.get(i);
|
||||
int j;
|
||||
for(j=0; j<f->surfs.size(); j++) {
|
||||
Surface* s = (Surface*)f->surfs.get(j);
|
||||
if( isVersionOrNewer( YASIM_VERSION_32 ) ) {
|
||||
// For new YASim, the solver drag factor is only applied to
|
||||
// the X axis for Fuselage Surfaces.
|
||||
// The solver is tuning the coefficient for longitudinal drag,
|
||||
// along the direction of flight. A fuselage's lateral drag
|
||||
// is completely independent and is normally much higher;
|
||||
// it won't be affected by the streamlining done to reduce
|
||||
// longitudinal drag. So the solver should only adjust the
|
||||
// fuselage's longitudinal (X axis) drag coefficient.
|
||||
s->setXDrag(s->getXDrag() * applied);
|
||||
} else {
|
||||
// Originally YASim applied the drag factor to all axes
|
||||
// for Fuselage Surfaces.
|
||||
s->setDragCoefficient(s->getDragCoefficient() * applied);
|
||||
}
|
||||
}
|
||||
}
|
||||
for(i=0; i<_weights.size(); i++) {
|
||||
WeightRec* wr = (WeightRec*)_weights.get(i);
|
||||
|
|
|
@ -853,7 +853,7 @@ Wing* FGFDM::parseWing(XMLAttributes* a, const char* type, Version * version)
|
|||
w->setInducedDrag(0.7*attrf(a, "idrag", 1));
|
||||
|
||||
float effect = attrf(a, "effectiveness", 1);
|
||||
w->setDragScale(w->getDragScale()*effect);
|
||||
w->multiplyDragCoefficient(effect);
|
||||
|
||||
_currObj = w;
|
||||
return w;
|
||||
|
|
|
@ -253,7 +253,7 @@ void Wing::addSurface(Surface* s, float weight, float twist)
|
|||
_surfs.add(sr);
|
||||
}
|
||||
|
||||
void Wing::setDragScale(float scale)
|
||||
void Wing::setDragCoefficient(float scale)
|
||||
{
|
||||
_dragScale = scale;
|
||||
for(int i=0; i<_surfs.size(); i++) {
|
||||
|
@ -262,6 +262,11 @@ void Wing::setDragScale(float scale)
|
|||
}
|
||||
}
|
||||
|
||||
void Wing::multiplyDragCoefficient(float factor)
|
||||
{
|
||||
setDragCoefficient(_dragScale * factor);
|
||||
}
|
||||
|
||||
void Wing::setLiftRatio(float ratio)
|
||||
{
|
||||
_liftRatio = ratio;
|
||||
|
|
|
@ -90,8 +90,8 @@ public:
|
|||
|
||||
// The overall drag coefficient for the wing as a whole. Units are
|
||||
// arbitrary.
|
||||
void setDragScale(float scale);
|
||||
float getDragScale() const { return _dragScale; }
|
||||
void setDragCoefficient(float scale);
|
||||
void multiplyDragCoefficient(float factor);
|
||||
|
||||
// The ratio of force along the Z (lift) direction of each wing
|
||||
// segment to that along the X (drag) direction.
|
||||
|
|
Loading…
Add table
Reference in a new issue