]> git.mxchange.org Git - flightgear.git/commitdiff
Support gear compression along axes other than vertical (Vivian needs
authorandy <andy>
Fri, 14 Oct 2005 21:20:51 +0000 (21:20 +0000)
committerandy <andy>
Fri, 14 Oct 2005 21:20:51 +0000 (21:20 +0000)
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...

src/FDM/YASim/FGFDM.cpp

index b343b41e13d6bbf5af18610f2c56dcc0320ca7cc..cd24f7b7f380a0cb796d90dee732f7274b8c1938 100644 (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));