]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/groundcache.cxx
Really implement fgWarpMouse for osgviewer
[flightgear.git] / src / FDM / groundcache.cxx
index 2cedf7cc811da7f93abf4dfa5a60c1fe822ed19e..035302dacb04c38c693053be75afc7df502c327e 100644 (file)
@@ -194,11 +194,6 @@ public:
 
     FGGroundCache::GroundProperty& gp = mGroundProperty;
     // get some material information for use in the gear model
-    gp.material = globals->get_matlib()->findMaterial(&node);
-    if (gp.material) {
-      gp.type = gp.material->get_solid() ? FGInterface::Solid : FGInterface::Water;
-      return true;
-    }
     gp.type = FGInterface::Unknown;
     osg::Referenced* base = node.getUserData();
     if (!base)
@@ -235,6 +230,12 @@ public:
     bool oldBackfaceCulling = mBackfaceCulling;
     updateCullMode(drawable->getStateSet());
 
+    FGGroundCache::GroundProperty& gp = mGroundProperty;
+    // get some material information for use in the gear model
+    gp.material = globals->get_matlib()->findMaterial(drawable->getStateSet());
+    if (gp.material)
+      gp.type = gp.material->get_solid() ? FGInterface::Solid : FGInterface::Water;
+
     drawable->accept(mTriangleFunctor);
 
     mBackfaceCulling = oldBackfaceCulling;