1
0
Fork 0

Add "spring" and "damp" tunables to gear objects.

This commit is contained in:
andy 2002-11-09 21:08:10 +00:00
parent 3640aca191
commit e8e1a087fe
2 changed files with 5 additions and 2 deletions

View file

@ -637,10 +637,11 @@ void Airplane::solveGear()
// Energy in a spring: e = 0.5 * k * len^2
float k = 2 * e / (len*len);
gr->gear->setSpring(k);
gr->gear->setSpring(k * gr->gear->getSpring());
// Critically damped (too damped, too!)
gr->gear->setDamping(2*Math::sqrt(k*_approachWeight*gr->wgt));
gr->gear->setDamping(2*Math::sqrt(k*_approachWeight*gr->wgt)
* gr->gear->getDamping());
// These are pretty generic
gr->gear->setStaticFriction(0.8f);

View file

@ -175,6 +175,8 @@ void FGFDM::startElement(const char* name, const XMLAttributes &atts)
g->setBrake(attrf(a, "skid", 0));
g->setStaticFriction(attrf(a, "sfric", 0.8));
g->setDynamicFriction(attrf(a, "dfric", 0.7));
g->setSpring(attrf(a, "spring", 1));
g->setDamping(attrf(a, "damp", 1));
_airplane.addGear(g);
} else if(eq(name, "fuselage")) {
float b[3];