]> git.mxchange.org Git - flightgear.git/commitdiff
Specify "clip planes" as a separate independent option (not implied from
authorcurt <curt>
Fri, 28 Jul 2006 20:17:58 +0000 (20:17 +0000)
committercurt <curt>
Fri, 28 Jul 2006 20:17:58 +0000 (20:17 +0000)
the type option.)  The clip area is and has always been hard coded, but at
some point we should make it configurable.

src/Instrumentation/HUD/HUD.hxx
src/Instrumentation/HUD/HUD_ladder.cxx

index 56b1831a9359d8aea71778517a0bb0c716f621a8..8456fd98502021ab569589b5a35964dc632aa601 100644 (file)
@@ -573,6 +573,7 @@ private:
     float  _vmin;
     float  _compression;
     bool   _dynamic_origin;
+    bool   _clip_plane;
     bool   _frl;               // fuselage reference line
     bool   _target_spot;
     bool   _target_markers;
index 86531da6f753528fcdf73b04a62c2c97ff50aade..680cbc848c64d6547ddd0263b16a0a36b84cedd9 100644 (file)
@@ -51,6 +51,7 @@ HUD::Ladder::Ladder(HUD *hud, const SGPropertyNode *n, float x, float y) :
     _scr_hole(n->getIntValue("screen-hole")),
     _compression(n->getFloatValue("compression-factor")),
     _dynamic_origin(n->getBoolValue("enable-dynamic-origin")),
+    _clip_plane(n->getBoolValue("enable-clip-plane")),
     _frl(n->getBoolValue("enable-fuselage-ref-line")),
     _target_spot(n->getBoolValue("enable-target-spot")),
     _target_markers(n->getBoolValue("enable-target-markers")),
@@ -87,18 +88,6 @@ void HUD::Ladder::draw(void)
     float pitch_value = _pitch.getFloatValue();
     float alpha;
 
-    bool pitch_ladder;
-    bool clip_plane;
-
-    if (_type == CLIMB_DIVE) {
-        pitch_ladder = false;
-        clip_plane = true;
-
-    } else { // _type == PITCH
-        pitch_ladder = true;
-        clip_plane = false;
-    }
-
     //**************************************************************
     glPushMatrix();
     glTranslatef(_center_x, _center_y, 0);
@@ -200,8 +189,9 @@ void HUD::Ladder::draw(void)
 
         //****************************************************************
         // Clipping coordinates for ladder to be input from xml file
-        // Clip hud ladder
-        if (clip_plane) {
+        // Clip hud ladder.  FIXME, these should be configurable, but they
+        // have always been hardcoded here.
+        if (_clip_plane) {
             GLdouble eqn_top[4] = {0.0, -1.0, 0.0, 0.0};
             GLdouble eqn_left[4] = {-1.0, 0.0, 0.0, 100.0};
             GLdouble eqn_right[4] = {1.0, 0.0, 0.0, 100.0};