From d9723e6805c98c820cc11a1ab0948443e6bed450 Mon Sep 17 00:00:00 2001 From: curt Date: Fri, 28 Jul 2006 20:17:58 +0000 Subject: [PATCH] Specify "clip planes" as a separate independent option (not implied from 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 | 1 + src/Instrumentation/HUD/HUD_ladder.cxx | 18 ++++-------------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/Instrumentation/HUD/HUD.hxx b/src/Instrumentation/HUD/HUD.hxx index 56b1831a9..8456fd985 100644 --- a/src/Instrumentation/HUD/HUD.hxx +++ b/src/Instrumentation/HUD/HUD.hxx @@ -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; diff --git a/src/Instrumentation/HUD/HUD_ladder.cxx b/src/Instrumentation/HUD/HUD_ladder.cxx index 86531da6f..680cbc848 100644 --- a/src/Instrumentation/HUD/HUD_ladder.cxx +++ b/src/Instrumentation/HUD/HUD_ladder.cxx @@ -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};