Set the RPM from the property tree with each iteration. This allows a
YASim prop model to start with the prop spinning.
This commit is contained in:
parent
202e79b4ad
commit
d4b9ca371c
1 changed files with 13 additions and 0 deletions
|
@ -308,6 +308,8 @@ void FGFDM::startElement(const char* name, const XMLAttributes &atts)
|
||||||
|
|
||||||
void FGFDM::getExternalInput(float dt)
|
void FGFDM::getExternalInput(float dt)
|
||||||
{
|
{
|
||||||
|
char buf[256];
|
||||||
|
|
||||||
// The control axes
|
// The control axes
|
||||||
ControlMap* cm = _airplane.getControlMap();
|
ControlMap* cm = _airplane.getControlMap();
|
||||||
cm->reset();
|
cm->reset();
|
||||||
|
@ -324,6 +326,17 @@ void FGFDM::getExternalInput(float dt)
|
||||||
WeightRec* wr = (WeightRec*)_weights.get(i);
|
WeightRec* wr = (WeightRec*)_weights.get(i);
|
||||||
_airplane.setWeight(wr->handle, LBS2KG * fgGetFloat(wr->prop));
|
_airplane.setWeight(wr->handle, LBS2KG * fgGetFloat(wr->prop));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for(i=0; i<_thrusters.size(); i++) {
|
||||||
|
EngRec* er = (EngRec*)_thrusters.get(i);
|
||||||
|
Thruster* t = er->eng;
|
||||||
|
|
||||||
|
if(t->getPropEngine()) {
|
||||||
|
PropEngine* p = t->getPropEngine();
|
||||||
|
sprintf(buf, "%s/rpm", er->prefix);
|
||||||
|
p->setOmega(fgGetFloat(buf) * RPM2RAD);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FGFDM::setOutputProperties()
|
void FGFDM::setOutputProperties()
|
||||||
|
|
Loading…
Add table
Reference in a new issue