]> git.mxchange.org Git - flightgear.git/commitdiff
Josh wanted a compression-m value exported for gear, so he can animate
authorandy <andy>
Thu, 24 Nov 2005 17:35:42 +0000 (17:35 +0000)
committerandy <andy>
Thu, 24 Nov 2005 17:35:42 +0000 (17:35 +0000)
them more accurately.

src/FDM/YASim/Gear.cpp
src/FDM/YASim/Gear.hpp
src/FDM/YASim/YASim.cxx

index 7950c2ef2d98263379514f099cf01cbb2a440c9e..1936c3594bc4016240908396559a8c5565504a7f 100644 (file)
@@ -180,9 +180,11 @@ void Gear::calcForce(RigidBody* body, State *s, float* v, float* rot)
     // First off, make sure that the gear "tip" is below the ground.
     // If it's not, there's no force.
     float a = ground[3] - Math::dot3(_pos, ground);
+    _compressDist = -a;
     if(a > 0) {
        _wow = 0;
        _frac = 0;
+        _compressDist = 0;
         _rollSpeed = 0;
         _casterAngle = 0;
        return;
index 6b0301fe1767bd94f5d261ae53d51257156afb34..435ca497301ad0a88d3bc219f58a7ee89e3287f0 100644 (file)
@@ -66,6 +66,7 @@ public:
     void getForce(float* force, float* contact);
     float getWoW();
     float getCompressFraction();
+    float getCompressDist() { return _compressDist; }
 
 private:
     float calcFriction(float wgt, float v);
@@ -84,6 +85,7 @@ private:
     float _contact[3];
     float _wow;
     float _frac;
+    float _compressDist;
     double _global_ground[4];
     float _global_vel[3];
     float _casterAngle;
index febabc481bbc2dc51907f2e46103d3de7dc0f113..c9f51e9c7312e2af8bc656fc03158bb073eb9c05 100644 (file)
@@ -461,6 +461,7 @@ void YASim::copyFromYASim()
        node->setBoolValue("has-brake", g->getBrake() != 0);
        node->setBoolValue("wow", g->getCompressFraction() != 0);
        node->setFloatValue("compression-norm", g->getCompressFraction());
+       node->setFloatValue("compression-m", g->getCompressDist());
         node->setFloatValue("caster-angle-deg", g->getCasterAngle() * RAD2DEG);
         node->setFloatValue("rollspeed-ms", g->getRollSpeed());
     }