]> git.mxchange.org Git - flightgear.git/commitdiff
Ensure that the aircraft model is in the same clip plane as everything
authordavid <david>
Sat, 13 Apr 2002 12:11:27 +0000 (12:11 +0000)
committerdavid <david>
Sat, 13 Apr 2002 12:11:27 +0000 (12:11 +0000)
else and *doesn't* clear the z-buffer when in external view; tighten
the far plane for internal view back to 100m to give us maximum
precision (this will be important for some instruments; I might even
move it to 50m).

src/Model/acmodel.cxx

index 159969c2ab1b2e133f4b923851752f045e8fd045..16c1f1c56a9a8dc73f4ffc3b36bd339512a6a83d 100644 (file)
@@ -32,7 +32,7 @@ FGAircraftModel::FGAircraftModel ()
   : _aircraft(0),
     _scene(new ssgRoot),
     _nearplane(0.01f),
-    _farplane(5000.0f)
+    _farplane(100.0f)
 {
 }
 
@@ -89,10 +89,13 @@ FGAircraftModel::draw ()
                                // OK, now adjust the clip planes and draw
                                // FIXME: view number shouldn't be 
                                // hard-coded.
+  int view_number = globals->get_viewmgr()->get_current();
   if (_aircraft->getVisible()) {
-    glClearDepth(1);
-    glClear(GL_DEPTH_BUFFER_BIT);
-    ssgSetNearFar(_nearplane, _farplane);
+    if (view_number == 0) {
+      glClearDepth(1);
+      glClear(GL_DEPTH_BUFFER_BIT);
+      ssgSetNearFar(_nearplane, _farplane);
+    }
     ssgCullAndDraw(_scene);
   }