Merge branch 'next' of http://git.gitorious.org/fg/flightgear into next
This commit is contained in:
commit
ba9becbde1
4 changed files with 26 additions and 6 deletions
|
@ -144,6 +144,8 @@ FGJSBsim::FGJSBsim( double dt )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resetPropertyState();
|
||||||
|
|
||||||
fdmex = new FGFDMExec( (FGPropertyManager*)globals->get_props() );
|
fdmex = new FGFDMExec( (FGPropertyManager*)globals->get_props() );
|
||||||
|
|
||||||
// Register ground callback.
|
// Register ground callback.
|
||||||
|
@ -290,6 +292,8 @@ FGJSBsim::FGJSBsim( double dt )
|
||||||
fgGetDouble("/fdm/jsbsim/systems/hook/tailhook-offset-x-in", 196),
|
fgGetDouble("/fdm/jsbsim/systems/hook/tailhook-offset-x-in", 196),
|
||||||
fgGetDouble("/fdm/jsbsim/systems/hook/tailhook-offset-y-in", 0),
|
fgGetDouble("/fdm/jsbsim/systems/hook/tailhook-offset-y-in", 0),
|
||||||
fgGetDouble("/fdm/jsbsim/systems/hook/tailhook-offset-z-in", -16));
|
fgGetDouble("/fdm/jsbsim/systems/hook/tailhook-offset-z-in", -16));
|
||||||
|
last_hook_tip[0] = 0; last_hook_tip[1] = 0; last_hook_tip[2] = 0;
|
||||||
|
last_hook_root[0] = 0; last_hook_root[1] = 0; last_hook_root[2] = 0;
|
||||||
|
|
||||||
crashed = false;
|
crashed = false;
|
||||||
}
|
}
|
||||||
|
@ -1411,3 +1415,21 @@ void FGJSBsim::update_external_forces(double t_off)
|
||||||
fgSetDouble("/fdm/jsbsim/systems/hook/tailhook-pos-deg", fi);
|
fgSetDouble("/fdm/jsbsim/systems/hook/tailhook-pos-deg", fi);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FGJSBsim::resetPropertyState()
|
||||||
|
{
|
||||||
|
// this code works-around bug #222:
|
||||||
|
// http://code.google.com/p/flightgear-bugs/issues/detail?id=222
|
||||||
|
// for whatever reason, having an existing value for the WOW
|
||||||
|
// property causes the NaNs. Should that be fixed, this code can die
|
||||||
|
SGPropertyNode* gear = fgGetNode("/fdm/jsbsim/gear", false);
|
||||||
|
if (!gear) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int index = 0;
|
||||||
|
SGPropertyNode* unitNode = NULL;
|
||||||
|
for (; (unitNode = gear->getChild("unit", index)) != NULL; ++index) {
|
||||||
|
unitNode->removeChild("WOW", 0, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -284,6 +284,7 @@ private:
|
||||||
|
|
||||||
void update_external_forces(double t_off);
|
void update_external_forces(double t_off);
|
||||||
|
|
||||||
|
void resetPropertyState();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -78,7 +78,8 @@ static const char *IdHdr = ID_PROPAGATE;
|
||||||
CLASS IMPLEMENTATION
|
CLASS IMPLEMENTATION
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||||
|
|
||||||
FGPropagate::FGPropagate(FGFDMExec* fdmex) : FGModel(fdmex)
|
FGPropagate::FGPropagate(FGFDMExec* fdmex) : FGModel(fdmex),
|
||||||
|
LocalTerrainRadius(0), SeaLevelRadius(0), VehicleRadius(0)
|
||||||
{
|
{
|
||||||
Debug(0);
|
Debug(0);
|
||||||
Name = "FGPropagate";
|
Name = "FGPropagate";
|
||||||
|
|
|
@ -307,23 +307,18 @@ bool FGPropulsion::Load(Element* el)
|
||||||
try {
|
try {
|
||||||
if (type == "piston_engine") {
|
if (type == "piston_engine") {
|
||||||
HavePistonEngine = true;
|
HavePistonEngine = true;
|
||||||
if (!IsBound) bind();
|
|
||||||
Engines.push_back(new FGPiston(FDMExec, document, numEngines));
|
Engines.push_back(new FGPiston(FDMExec, document, numEngines));
|
||||||
} else if (type == "turbine_engine") {
|
} else if (type == "turbine_engine") {
|
||||||
HaveTurbineEngine = true;
|
HaveTurbineEngine = true;
|
||||||
if (!IsBound) bind();
|
|
||||||
Engines.push_back(new FGTurbine(FDMExec, document, numEngines));
|
Engines.push_back(new FGTurbine(FDMExec, document, numEngines));
|
||||||
} else if (type == "turboprop_engine") {
|
} else if (type == "turboprop_engine") {
|
||||||
HaveTurboPropEngine = true;
|
HaveTurboPropEngine = true;
|
||||||
if (!IsBound) bind();
|
|
||||||
Engines.push_back(new FGTurboProp(FDMExec, document, numEngines));
|
Engines.push_back(new FGTurboProp(FDMExec, document, numEngines));
|
||||||
} else if (type == "rocket_engine") {
|
} else if (type == "rocket_engine") {
|
||||||
HaveRocketEngine = true;
|
HaveRocketEngine = true;
|
||||||
if (!IsBound) bind();
|
|
||||||
Engines.push_back(new FGRocket(FDMExec, document, numEngines));
|
Engines.push_back(new FGRocket(FDMExec, document, numEngines));
|
||||||
} else if (type == "electric_engine") {
|
} else if (type == "electric_engine") {
|
||||||
HaveElectricEngine = true;
|
HaveElectricEngine = true;
|
||||||
if (!IsBound) bind();
|
|
||||||
Engines.push_back(new FGElectric(FDMExec, document, numEngines));
|
Engines.push_back(new FGElectric(FDMExec, document, numEngines));
|
||||||
} else {
|
} else {
|
||||||
cerr << "Unknown engine type: " << type << endl;
|
cerr << "Unknown engine type: " << type << endl;
|
||||||
|
@ -350,6 +345,7 @@ bool FGPropulsion::Load(Element* el)
|
||||||
if (el->FindElement("dump-rate"))
|
if (el->FindElement("dump-rate"))
|
||||||
DumpRate = el->FindElementValueAsNumberConvertTo("dump-rate", "LBS/MIN");
|
DumpRate = el->FindElementValueAsNumberConvertTo("dump-rate", "LBS/MIN");
|
||||||
|
|
||||||
|
if (!IsBound) bind();
|
||||||
PostLoad(el, PropertyManager);
|
PostLoad(el, PropertyManager);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue