]> git.mxchange.org Git - flightgear.git/commitdiff
Modified Files:
authorfrohlich <frohlich>
Tue, 2 Jan 2007 09:50:35 +0000 (09:50 +0000)
committerfrohlich <frohlich>
Tue, 2 Jan 2007 09:50:35 +0000 (09:50 +0000)
src/FDM/groundcache.cxx src/FDM/groundcache.hxx: Store the material
that was used to get the croase agl level and return that material
in case we need to make use of that croase value.

src/FDM/groundcache.cxx
src/FDM/groundcache.hxx

index 3ffc28331cf227b6654f35c68c4eaec1e999506b..1fad256c5dde314f16835c4609b61118b1cc416d 100644 (file)
@@ -364,6 +364,7 @@ public:
       gp.type = gp.material->get_solid() ? FGInterface::Solid : FGInterface::Water;
       return true;
     }
+    gp.type = FGInterface::Unknown;
     osg::Referenced* base = node.getUserData();
     if (!base)
       return true;
@@ -527,7 +528,7 @@ public:
         t.rotation = mGroundProperty.rot;
         t.rotation_pivot = mGroundProperty.pivot - mGroundCache->cache_center;
         t.type = mGroundProperty.type;
-        t.material=mGroundProperty.material;
+        t.material = mGroundProperty.material;
         mGroundCache->triangles.push_back(t);
       }
     }
@@ -543,8 +544,11 @@ public:
       isectpoint.osg() = isectpoint.osg()*mLocalToGlobal;
       isectpoint += mGroundCache->cache_center;
       double this_radius = length(isectpoint);
-      if (mGroundCache->ground_radius < this_radius)
+      if (mGroundCache->ground_radius < this_radius) {
         mGroundCache->ground_radius = this_radius;
+        mGroundCache->_type = mGroundProperty.type;
+        mGroundCache->_material = mGroundProperty.material;
+      }
     }
   }
   
@@ -840,7 +844,9 @@ FGGroundCache::get_agl(double t, const SGVec3d& dpt, double max_altoff,
   // The altitude is the distance of the requested point from the
   // contact point.
   *agl = dot(down, contact - dpt);
-  *type = FGInterface::Unknown;
+  *type = _type;
+  if (material)
+    *material = _material;
 
   return ret;
 }
index 754d539215154eba647a8aa2c8571ac20427dcf9..f00fb40c1e9904df3b910ae751f6ced7f1c473ca 100644 (file)
@@ -122,6 +122,10 @@ private:
     // Approximate ground radius.
     // In case the aircraft is too high above ground.
     double ground_radius;
+    // Ground type
+    int _type;
+    // the simgear material reference, contains friction coeficients ...
+    const SGMaterial* _material;
     // The time reference for later call to intersection test routines.
     // Is required since we will have moving triangles in carriers.
     double cache_ref_time;