1
0
Fork 0

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.
This commit is contained in:
curt 2006-07-28 20:17:58 +00:00
parent 1576fc1050
commit d9723e6805
2 changed files with 5 additions and 14 deletions

View 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;

View 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};