1
0
Fork 0

YASIM rename methods in class Surface

This commit is contained in:
Henning Stahlke 2017-11-18 21:07:16 +01:00
parent 1f721fb6d8
commit 1194b09525
3 changed files with 12 additions and 12 deletions

View file

@ -240,7 +240,7 @@ int Airplane::addWeight(float* pos, float size)
wr->surf = new Surface(this);
wr->surf->setPosition(pos);
wr->surf->setTotalDrag(size*size);
wr->surf->setDragCoefficient(size*size);
_model.addSurface(wr->surf);
_surfs.add(wr->surf);
@ -329,7 +329,7 @@ float Airplane::compileWing(Wing* w)
float dragSum = 0;
for(int i=0; i<w->numSurfaces(); i++) {
Surface* s = (Surface*)w->getSurface(i);
float td = s->getTotalDrag();
float td = s->getDragCoefficient();
int sid = s->getID();
_model.addSurface(s);
@ -437,9 +437,9 @@ float Airplane::compileFuselage(Fuselage* f)
s->setYDrag(sideDrag*f->_cy);
s->setZDrag(sideDrag*f->_cz);
if( isVersionOrNewer( YASIM_VERSION_32 ) ) {
s->setTotalDrag(scale*segWgt);
s->setDragCoefficient(scale*segWgt);
} else {
s->setTotalDrag(scale*segWgt*f->_cx);
s->setDragCoefficient(scale*segWgt*f->_cx);
}
s->setInducedDrag(f->_idrag);
@ -481,7 +481,7 @@ void Airplane::compileGear(GearRec* gr)
Math::add3(pos, cmp, pos);
s->setPosition(pos);
s->setTotalDrag(length*length);
s->setDragCoefficient(length*length);
_model.addGear(g);
_model.addSurface(s);
@ -826,17 +826,17 @@ void Airplane::applyDragFactor(float factor)
} else {
// Originally YASim applied the drag factor to all axes
// for Fuselage Surfaces.
s->setTotalDrag(s->getTotalDrag() * applied);
s->setDragCoefficient(s->getDragCoefficient() * applied);
}
}
}
for(i=0; i<_weights.size(); i++) {
WeightRec* wr = (WeightRec*)_weights.get(i);
wr->surf->setTotalDrag(wr->surf->getTotalDrag() * applied);
wr->surf->setDragCoefficient(wr->surf->getDragCoefficient() * applied);
}
for(i=0; i<_gears.size(); i++) {
GearRec* gr = (GearRec*)_gears.get(i);
gr->surf->setTotalDrag(gr->surf->getTotalDrag() * applied);
gr->surf->setDragCoefficient(gr->surf->getDragCoefficient() * applied);
}
}

View file

@ -59,8 +59,8 @@ public:
// The offset from base incidence for this surface.
void setTwist(float angle) { _twist = angle; }
void setTotalDrag(float c0) { _c0 = c0; }
float getTotalDrag() const { return _c0; }
void setDragCoefficient(float c0) { _c0 = c0; }
float getDragCoefficient() const { return _c0; }
void setXDrag(float cx) { _cx = cx; }
void setYDrag(float cy) { _cy = cy; }

View file

@ -247,7 +247,7 @@ void Wing::addSurface(Surface* s, float weight, float twist)
SurfRec *sr = new SurfRec();
sr->surface = s;
sr->weight = weight;
s->setTotalDrag(sr->weight);
s->setDragCoefficient(sr->weight);
s->setTwist(twist);
_surfs.add(sr);
}
@ -257,7 +257,7 @@ void Wing::setDragScale(float scale)
_dragScale = scale;
for(int i=0; i<_surfs.size(); i++) {
SurfRec* s = (SurfRec*)_surfs.get(i);
s->surface->setTotalDrag(scale * s->weight);
s->surface->setDragCoefficient(scale * s->weight);
}
}