1
0
Fork 0

Support gear compression along axes other than vertical (Vivian needs

it for the B-29).  The gear model itself has supported this always,
but there was no interface from the XML file.  Should be backwards
compatible.  I don't think I broke anything...
This commit is contained in:
andy 2005-10-14 21:20:51 +00:00
parent dafa6ced1b
commit bd917a47d8

View file

@ -238,9 +238,18 @@ void FGFDM::startElement(const char* name, const XMLAttributes &atts)
float nrm = Math::mag3(v);
if (_vehicle_radius < nrm)
_vehicle_radius = nrm;
v[0] = 0;
v[1] = 0;
v[2] = attrf(a, "compression", 1);
if(a->hasAttribute("upx")) {
v[0] = attrf(a, "upx");
v[1] = attrf(a, "upy");
v[2] = attrf(a, "upz");
Math::unit3(v, v);
} else {
v[0] = 0;
v[1] = 0;
v[2] = 1;
}
for(int i=0; i<3; i++)
v[i] *= attrf(a, "compression", 1);
g->setCompression(v);
g->setBrake(attrf(a, "skid", 0));
g->setStaticFriction(attrf(a, "sfric", 0.8));