From: andy Date: Fri, 14 Oct 2005 21:20:51 +0000 (+0000) Subject: Support gear compression along axes other than vertical (Vivian needs X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=bd917a47d842492fa0f668e42374b875a7b4486f;p=flightgear.git 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... --- diff --git a/src/FDM/YASim/FGFDM.cpp b/src/FDM/YASim/FGFDM.cpp index b343b41e1..cd24f7b7f 100644 --- a/src/FDM/YASim/FGFDM.cpp +++ b/src/FDM/YASim/FGFDM.cpp @@ -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));