2006-02-18 13:58:09 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2005-10-25 13:49:55 +00:00
|
|
|
#include <simgear/constants.h>
|
|
|
|
|
1998-07-03 13:16:27 +00:00
|
|
|
#include "hud.hxx"
|
2000-10-18 21:19:30 +00:00
|
|
|
#include "panel.hxx"
|
2000-02-15 03:30:01 +00:00
|
|
|
|
|
|
|
|
2006-06-14 12:49:27 +00:00
|
|
|
// FIXME
|
|
|
|
extern float get_roll(void);
|
|
|
|
extern float get_pitch(void);
|
|
|
|
|
|
|
|
|
|
|
|
HudLadder::HudLadder(const SGPropertyNode *node) :
|
|
|
|
dual_instr_item(
|
|
|
|
node->getIntValue("x"),
|
|
|
|
node->getIntValue("y"),
|
|
|
|
node->getIntValue("width"),
|
|
|
|
node->getIntValue("height"),
|
|
|
|
get_roll,
|
|
|
|
get_pitch, // FIXME getter functions from cockpit.cxx
|
|
|
|
node->getBoolValue("working"),
|
|
|
|
HUDS_RIGHT),
|
|
|
|
width_units(int(node->getFloatValue("span_units"))),
|
|
|
|
div_units(int(fabs(node->getFloatValue("division_units")))),
|
|
|
|
minor_div(0 /* hud.cxx: static float minor_division = 0 */),
|
|
|
|
label_pos(node->getIntValue("lbl_pos")),
|
|
|
|
scr_hole(node->getIntValue("screen_hole")),
|
|
|
|
factor(node->getFloatValue("compression_factor")),
|
|
|
|
hudladder_type(node->getStringValue("name")),
|
|
|
|
frl(node->getBoolValue("enable_frl", false)),
|
|
|
|
target_spot(node->getBoolValue("enable_target_spot", false)),
|
|
|
|
velocity_vector(node->getBoolValue("enable_velocity_vector", false)),
|
|
|
|
drift_marker(node->getBoolValue("enable_drift_marker", false)),
|
|
|
|
alpha_bracket(node->getBoolValue("enable_alpha_bracket", false)),
|
|
|
|
energy_marker(node->getBoolValue("enable_energy_marker", false)),
|
|
|
|
climb_dive_marker(node->getBoolValue("enable_climb_dive_marker", false)),
|
|
|
|
glide_slope_marker(node->getBoolValue("enable_glide_slope_marker",false)),
|
|
|
|
glide_slope(node->getFloatValue("glide_slope", -4.0)),
|
|
|
|
energy_worm(node->getBoolValue("enable_energy_marker", false)),
|
|
|
|
waypoint_marker(node->getBoolValue("enable_waypoint_marker", false)),
|
|
|
|
zenith(node->getIntValue("zenith")),
|
|
|
|
nadir(node->getIntValue("nadir")),
|
|
|
|
hat(node->getIntValue("hat"))
|
2001-01-05 16:44:48 +00:00
|
|
|
{
|
2006-06-14 12:49:27 +00:00
|
|
|
// The factor assumes a base of 55 degrees per 640 pixels.
|
|
|
|
// Invert to convert the "compression" factor to a
|
|
|
|
// pixels-per-degree number.
|
|
|
|
if (fgGetBool("/sim/hud/enable3d", true) && HUD_style == 1)
|
2006-06-14 16:23:44 +00:00
|
|
|
factor = 640.0 / 55.0;
|
2006-06-14 12:49:27 +00:00
|
|
|
|
2006-06-14 16:23:44 +00:00
|
|
|
SG_LOG(SG_INPUT, SG_INFO, "Done reading HudLadder instrument"
|
|
|
|
<< node->getStringValue("name", "[NONE]"));
|
2006-06-12 21:34:47 +00:00
|
|
|
|
|
|
|
if (!width_units)
|
|
|
|
width_units = 45;
|
|
|
|
|
2006-06-14 12:49:27 +00:00
|
|
|
vmax = width_units / 2;
|
|
|
|
vmin = -vmax;
|
2001-01-05 16:44:48 +00:00
|
|
|
}
|
2006-06-12 21:34:47 +00:00
|
|
|
|
|
|
|
|
1998-07-03 13:16:27 +00:00
|
|
|
//
|
1999-05-12 02:04:38 +00:00
|
|
|
// Draws a climb ladder in the center of the HUD
|
1998-07-03 13:16:27 +00:00
|
|
|
//
|
2001-01-05 16:44:48 +00:00
|
|
|
|
2006-06-14 12:49:27 +00:00
|
|
|
void HudLadder::draw(void)
|
The following changes were made to flightgear-0.7.5 code to implement the follow
ing features:
a) ADA Flight model - ADA.cxx, ADA.hxx, flight.hxx
b) Fighter a/c HUD - flight.hxx, hud.hxx, hud.cxx, cockpit.cxx, hud_ladr.c
xx, hud_card.cxx
c) 3-window display - options.hxx, options.cxx, viewer.cxx
d) Moving objects (ship) - main.cxx
e) Patches - main.cxx
ADA.cxx, ADA.hxx
--------------------------
Interface to the external ADA flight dynamics package.
flight.hxx
----------
Included prototypes for accepting additional data fron the External flight
model for fighter aircraft HUD
Hud.hxx
-------
Included prototypes for accepting additional data for fighter HUD from Exernal F
light model.
Defined FIGHTER_HUD pre-processor directive to enable compilation of fighter hud
code.
hud.cxx, cockpit.cxx, hud_ladr.cxx, hud_card.cxx
---------------------------------------
Included code to initialise additional reticles/text for fighter HUD which is co
nditionally
compiled if FIGHTER_HUD is defined.
options.hxx
-----------
Added window_offset, and function to retrieve its value for 3 windows
options.cxx
-----------
Changed few options to suit ADA/CEF projection system/screens and checks for win
dow offset.
views.cxx
---------
Added code to retrieve view offset for window.
Main.cxx
--------
Added code to load and move an aircraft carrier.
Patch to enable clouds from command line until Curtis fixes it. By default cloud
s are disabled.
2000-10-19 19:46:13 +00:00
|
|
|
{
|
2001-01-05 16:44:48 +00:00
|
|
|
|
2006-06-14 12:49:27 +00:00
|
|
|
float x_ini, x_ini2;
|
|
|
|
float x_end, x_end2;
|
|
|
|
float y = 0;
|
The following changes were made to flightgear-0.7.5 code to implement the follow
ing features:
a) ADA Flight model - ADA.cxx, ADA.hxx, flight.hxx
b) Fighter a/c HUD - flight.hxx, hud.hxx, hud.cxx, cockpit.cxx, hud_ladr.c
xx, hud_card.cxx
c) 3-window display - options.hxx, options.cxx, viewer.cxx
d) Moving objects (ship) - main.cxx
e) Patches - main.cxx
ADA.cxx, ADA.hxx
--------------------------
Interface to the external ADA flight dynamics package.
flight.hxx
----------
Included prototypes for accepting additional data fron the External flight
model for fighter aircraft HUD
Hud.hxx
-------
Included prototypes for accepting additional data for fighter HUD from Exernal F
light model.
Defined FIGHTER_HUD pre-processor directive to enable compilation of fighter hud
code.
hud.cxx, cockpit.cxx, hud_ladr.cxx, hud_card.cxx
---------------------------------------
Included code to initialise additional reticles/text for fighter HUD which is co
nditionally
compiled if FIGHTER_HUD is defined.
options.hxx
-----------
Added window_offset, and function to retrieve its value for 3 windows
options.cxx
-----------
Changed few options to suit ADA/CEF projection system/screens and checks for win
dow offset.
views.cxx
---------
Added code to retrieve view offset for window.
Main.cxx
--------
Added code to load and move an aircraft carrier.
Patch to enable clouds from command line until Curtis fixes it. By default cloud
s are disabled.
2000-10-19 19:46:13 +00:00
|
|
|
int count;
|
2006-06-14 12:49:27 +00:00
|
|
|
float cosine, sine, xvvr, yvvr, Vxx = 0.0, Vyy = 0.0, Vzz = 0.0;
|
|
|
|
float up_vel, ground_vel, actslope = 0.0;
|
|
|
|
float Axx = 0.0, Ayy = 0.0, Azz = 0.0, total_vel = 0.0, pot_slope, t1;
|
|
|
|
float t2 = 0.0, psi = 0.0, alpha, pla;
|
2001-06-12 23:37:29 +00:00
|
|
|
float vel_x = 0.0, vel_y = 0.0, drift;
|
2006-06-14 12:49:27 +00:00
|
|
|
bool pitch_ladder = false;
|
|
|
|
bool climb_dive_ladder = false;
|
|
|
|
bool clip_plane = false;
|
The following changes were made to flightgear-0.7.5 code to implement the follow
ing features:
a) ADA Flight model - ADA.cxx, ADA.hxx, flight.hxx
b) Fighter a/c HUD - flight.hxx, hud.hxx, hud.cxx, cockpit.cxx, hud_ladr.c
xx, hud_card.cxx
c) 3-window display - options.hxx, options.cxx, viewer.cxx
d) Moving objects (ship) - main.cxx
e) Patches - main.cxx
ADA.cxx, ADA.hxx
--------------------------
Interface to the external ADA flight dynamics package.
flight.hxx
----------
Included prototypes for accepting additional data fron the External flight
model for fighter aircraft HUD
Hud.hxx
-------
Included prototypes for accepting additional data for fighter HUD from Exernal F
light model.
Defined FIGHTER_HUD pre-processor directive to enable compilation of fighter hud
code.
hud.cxx, cockpit.cxx, hud_ladr.cxx, hud_card.cxx
---------------------------------------
Included code to initialise additional reticles/text for fighter HUD which is co
nditionally
compiled if FIGHTER_HUD is defined.
options.hxx
-----------
Added window_offset, and function to retrieve its value for 3 windows
options.cxx
-----------
Changed few options to suit ADA/CEF projection system/screens and checks for win
dow offset.
views.cxx
---------
Added code to retrieve view offset for window.
Main.cxx
--------
Added code to load and move an aircraft carrier.
Patch to enable clouds from command line until Curtis fixes it. By default cloud
s are disabled.
2000-10-19 19:46:13 +00:00
|
|
|
|
2006-06-14 12:49:27 +00:00
|
|
|
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};
|
The following changes were made to flightgear-0.7.5 code to implement the follow
ing features:
a) ADA Flight model - ADA.cxx, ADA.hxx, flight.hxx
b) Fighter a/c HUD - flight.hxx, hud.hxx, hud.cxx, cockpit.cxx, hud_ladr.c
xx, hud_card.cxx
c) 3-window display - options.hxx, options.cxx, viewer.cxx
d) Moving objects (ship) - main.cxx
e) Patches - main.cxx
ADA.cxx, ADA.hxx
--------------------------
Interface to the external ADA flight dynamics package.
flight.hxx
----------
Included prototypes for accepting additional data fron the External flight
model for fighter aircraft HUD
Hud.hxx
-------
Included prototypes for accepting additional data for fighter HUD from Exernal F
light model.
Defined FIGHTER_HUD pre-processor directive to enable compilation of fighter hud
code.
hud.cxx, cockpit.cxx, hud_ladr.cxx, hud_card.cxx
---------------------------------------
Included code to initialise additional reticles/text for fighter HUD which is co
nditionally
compiled if FIGHTER_HUD is defined.
options.hxx
-----------
Added window_offset, and function to retrieve its value for 3 windows
options.cxx
-----------
Changed few options to suit ADA/CEF projection system/screens and checks for win
dow offset.
views.cxx
---------
Added code to retrieve view offset for window.
Main.cxx
--------
Added code to load and move an aircraft carrier.
Patch to enable clouds from command line until Curtis fixes it. By default cloud
s are disabled.
2000-10-19 19:46:13 +00:00
|
|
|
|
2006-06-14 12:49:27 +00:00
|
|
|
POINT centroid = get_centroid();
|
|
|
|
RECT box = get_location();
|
The following changes were made to flightgear-0.7.5 code to implement the follow
ing features:
a) ADA Flight model - ADA.cxx, ADA.hxx, flight.hxx
b) Fighter a/c HUD - flight.hxx, hud.hxx, hud.cxx, cockpit.cxx, hud_ladr.c
xx, hud_card.cxx
c) 3-window display - options.hxx, options.cxx, viewer.cxx
d) Moving objects (ship) - main.cxx
e) Patches - main.cxx
ADA.cxx, ADA.hxx
--------------------------
Interface to the external ADA flight dynamics package.
flight.hxx
----------
Included prototypes for accepting additional data fron the External flight
model for fighter aircraft HUD
Hud.hxx
-------
Included prototypes for accepting additional data for fighter HUD from Exernal F
light model.
Defined FIGHTER_HUD pre-processor directive to enable compilation of fighter hud
code.
hud.cxx, cockpit.cxx, hud_ladr.cxx, hud_card.cxx
---------------------------------------
Included code to initialise additional reticles/text for fighter HUD which is co
nditionally
compiled if FIGHTER_HUD is defined.
options.hxx
-----------
Added window_offset, and function to retrieve its value for 3 windows
options.cxx
-----------
Changed few options to suit ADA/CEF projection system/screens and checks for win
dow offset.
views.cxx
---------
Added code to retrieve view offset for window.
Main.cxx
--------
Added code to load and move an aircraft carrier.
Patch to enable clouds from command line until Curtis fixes it. By default cloud
s are disabled.
2000-10-19 19:46:13 +00:00
|
|
|
|
2006-06-14 12:49:27 +00:00
|
|
|
float half_span = box.right / 2.0;
|
|
|
|
float roll_value = current_ch2();
|
The following changes were made to flightgear-0.7.5 code to implement the follow
ing features:
a) ADA Flight model - ADA.cxx, ADA.hxx, flight.hxx
b) Fighter a/c HUD - flight.hxx, hud.hxx, hud.cxx, cockpit.cxx, hud_ladr.c
xx, hud_card.cxx
c) 3-window display - options.hxx, options.cxx, viewer.cxx
d) Moving objects (ship) - main.cxx
e) Patches - main.cxx
ADA.cxx, ADA.hxx
--------------------------
Interface to the external ADA flight dynamics package.
flight.hxx
----------
Included prototypes for accepting additional data fron the External flight
model for fighter aircraft HUD
Hud.hxx
-------
Included prototypes for accepting additional data for fighter HUD from Exernal F
light model.
Defined FIGHTER_HUD pre-processor directive to enable compilation of fighter hud
code.
hud.cxx, cockpit.cxx, hud_ladr.cxx, hud_card.cxx
---------------------------------------
Included code to initialise additional reticles/text for fighter HUD which is co
nditionally
compiled if FIGHTER_HUD is defined.
options.hxx
-----------
Added window_offset, and function to retrieve its value for 3 windows
options.cxx
-----------
Changed few options to suit ADA/CEF projection system/screens and checks for win
dow offset.
views.cxx
---------
Added code to retrieve view offset for window.
Main.cxx
--------
Added code to load and move an aircraft carrier.
Patch to enable clouds from command line until Curtis fixes it. By default cloud
s are disabled.
2000-10-19 19:46:13 +00:00
|
|
|
alpha = get_aoa();
|
|
|
|
pla = get_throttleval();
|
|
|
|
|
2004-10-20 08:15:55 +00:00
|
|
|
#ifdef ENABLE_SP_FMDS
|
2006-06-14 12:49:27 +00:00
|
|
|
int lgear, wown, wowm, ilcanclaw, ihook;
|
2001-09-19 22:23:25 +00:00
|
|
|
ilcanclaw = get_iaux2();
|
|
|
|
lgear = get_iaux3();
|
|
|
|
wown = get_iaux4();
|
|
|
|
wowm = get_iaux5();
|
|
|
|
ihook = get_iaux6();
|
2004-10-20 08:15:55 +00:00
|
|
|
#endif
|
2001-03-24 04:48:44 +00:00
|
|
|
float pitch_value = current_ch1() * SGD_RADIANS_TO_DEGREES;
|
2006-06-12 21:34:47 +00:00
|
|
|
|
2006-06-14 12:49:27 +00:00
|
|
|
if (hudladder_type == "Climb/Dive Ladder") {
|
2006-06-12 21:34:47 +00:00
|
|
|
pitch_ladder = false;
|
|
|
|
climb_dive_ladder = true;
|
|
|
|
clip_plane = true;
|
2006-06-14 12:49:27 +00:00
|
|
|
|
|
|
|
} else { // hudladder_type == "Pitch Ladder"
|
2006-06-12 21:34:47 +00:00
|
|
|
pitch_ladder = true;
|
|
|
|
climb_dive_ladder = false;
|
|
|
|
clip_plane = false;
|
2001-01-05 16:44:48 +00:00
|
|
|
}
|
2006-06-12 21:34:47 +00:00
|
|
|
|
2001-01-05 16:44:48 +00:00
|
|
|
//**************************************************************
|
The following changes were made to flightgear-0.7.5 code to implement the follow
ing features:
a) ADA Flight model - ADA.cxx, ADA.hxx, flight.hxx
b) Fighter a/c HUD - flight.hxx, hud.hxx, hud.cxx, cockpit.cxx, hud_ladr.c
xx, hud_card.cxx
c) 3-window display - options.hxx, options.cxx, viewer.cxx
d) Moving objects (ship) - main.cxx
e) Patches - main.cxx
ADA.cxx, ADA.hxx
--------------------------
Interface to the external ADA flight dynamics package.
flight.hxx
----------
Included prototypes for accepting additional data fron the External flight
model for fighter aircraft HUD
Hud.hxx
-------
Included prototypes for accepting additional data for fighter HUD from Exernal F
light model.
Defined FIGHTER_HUD pre-processor directive to enable compilation of fighter hud
code.
hud.cxx, cockpit.cxx, hud_ladr.cxx, hud_card.cxx
---------------------------------------
Included code to initialise additional reticles/text for fighter HUD which is co
nditionally
compiled if FIGHTER_HUD is defined.
options.hxx
-----------
Added window_offset, and function to retrieve its value for 3 windows
options.cxx
-----------
Changed few options to suit ADA/CEF projection system/screens and checks for win
dow offset.
views.cxx
---------
Added code to retrieve view offset for window.
Main.cxx
--------
Added code to load and move an aircraft carrier.
Patch to enable clouds from command line until Curtis fixes it. By default cloud
s are disabled.
2000-10-19 19:46:13 +00:00
|
|
|
glPushMatrix();
|
2006-06-14 12:49:27 +00:00
|
|
|
// define (0, 0) as center of screen
|
|
|
|
glTranslatef(centroid.x, centroid.y, 0);
|
The following changes were made to flightgear-0.7.5 code to implement the follow
ing features:
a) ADA Flight model - ADA.cxx, ADA.hxx, flight.hxx
b) Fighter a/c HUD - flight.hxx, hud.hxx, hud.cxx, cockpit.cxx, hud_ladr.c
xx, hud_card.cxx
c) 3-window display - options.hxx, options.cxx, viewer.cxx
d) Moving objects (ship) - main.cxx
e) Patches - main.cxx
ADA.cxx, ADA.hxx
--------------------------
Interface to the external ADA flight dynamics package.
flight.hxx
----------
Included prototypes for accepting additional data fron the External flight
model for fighter aircraft HUD
Hud.hxx
-------
Included prototypes for accepting additional data for fighter HUD from Exernal F
light model.
Defined FIGHTER_HUD pre-processor directive to enable compilation of fighter hud
code.
hud.cxx, cockpit.cxx, hud_ladr.cxx, hud_card.cxx
---------------------------------------
Included code to initialise additional reticles/text for fighter HUD which is co
nditionally
compiled if FIGHTER_HUD is defined.
options.hxx
-----------
Added window_offset, and function to retrieve its value for 3 windows
options.cxx
-----------
Changed few options to suit ADA/CEF projection system/screens and checks for win
dow offset.
views.cxx
---------
Added code to retrieve view offset for window.
Main.cxx
--------
Added code to load and move an aircraft carrier.
Patch to enable clouds from command line until Curtis fixes it. By default cloud
s are disabled.
2000-10-19 19:46:13 +00:00
|
|
|
|
2001-01-05 16:44:48 +00:00
|
|
|
// OBJECT STATIC RETICLE
|
|
|
|
// TYPE FRL
|
|
|
|
// ATTRIB - ALWAYS
|
The following changes were made to flightgear-0.7.5 code to implement the follow
ing features:
a) ADA Flight model - ADA.cxx, ADA.hxx, flight.hxx
b) Fighter a/c HUD - flight.hxx, hud.hxx, hud.cxx, cockpit.cxx, hud_ladr.c
xx, hud_card.cxx
c) 3-window display - options.hxx, options.cxx, viewer.cxx
d) Moving objects (ship) - main.cxx
e) Patches - main.cxx
ADA.cxx, ADA.hxx
--------------------------
Interface to the external ADA flight dynamics package.
flight.hxx
----------
Included prototypes for accepting additional data fron the External flight
model for fighter aircraft HUD
Hud.hxx
-------
Included prototypes for accepting additional data for fighter HUD from Exernal F
light model.
Defined FIGHTER_HUD pre-processor directive to enable compilation of fighter hud
code.
hud.cxx, cockpit.cxx, hud_ladr.cxx, hud_card.cxx
---------------------------------------
Included code to initialise additional reticles/text for fighter HUD which is co
nditionally
compiled if FIGHTER_HUD is defined.
options.hxx
-----------
Added window_offset, and function to retrieve its value for 3 windows
options.cxx
-----------
Changed few options to suit ADA/CEF projection system/screens and checks for win
dow offset.
views.cxx
---------
Added code to retrieve view offset for window.
Main.cxx
--------
Added code to load and move an aircraft carrier.
Patch to enable clouds from command line until Curtis fixes it. By default cloud
s are disabled.
2000-10-19 19:46:13 +00:00
|
|
|
// Draw the FRL spot and line
|
2006-06-12 21:34:47 +00:00
|
|
|
if (frl) {
|
The following changes were made to flightgear-0.7.5 code to implement the follow
ing features:
a) ADA Flight model - ADA.cxx, ADA.hxx, flight.hxx
b) Fighter a/c HUD - flight.hxx, hud.hxx, hud.cxx, cockpit.cxx, hud_ladr.c
xx, hud_card.cxx
c) 3-window display - options.hxx, options.cxx, viewer.cxx
d) Moving objects (ship) - main.cxx
e) Patches - main.cxx
ADA.cxx, ADA.hxx
--------------------------
Interface to the external ADA flight dynamics package.
flight.hxx
----------
Included prototypes for accepting additional data fron the External flight
model for fighter aircraft HUD
Hud.hxx
-------
Included prototypes for accepting additional data for fighter HUD from Exernal F
light model.
Defined FIGHTER_HUD pre-processor directive to enable compilation of fighter hud
code.
hud.cxx, cockpit.cxx, hud_ladr.cxx, hud_card.cxx
---------------------------------------
Included code to initialise additional reticles/text for fighter HUD which is co
nditionally
compiled if FIGHTER_HUD is defined.
options.hxx
-----------
Added window_offset, and function to retrieve its value for 3 windows
options.cxx
-----------
Changed few options to suit ADA/CEF projection system/screens and checks for win
dow offset.
views.cxx
---------
Added code to retrieve view offset for window.
Main.cxx
--------
Added code to load and move an aircraft carrier.
Patch to enable clouds from command line until Curtis fixes it. By default cloud
s are disabled.
2000-10-19 19:46:13 +00:00
|
|
|
#define FRL_DIAMOND_SIZE 2.0
|
2006-06-12 21:34:47 +00:00
|
|
|
glBegin(GL_LINE_LOOP);
|
2006-06-14 12:49:27 +00:00
|
|
|
glVertex2f(-FRL_DIAMOND_SIZE, 0.0);
|
2006-06-12 21:34:47 +00:00
|
|
|
glVertex2f(0.0, FRL_DIAMOND_SIZE);
|
2006-06-14 12:49:27 +00:00
|
|
|
glVertex2f(FRL_DIAMOND_SIZE, 0.0);
|
2006-06-12 21:34:47 +00:00
|
|
|
glVertex2f(0.0, -FRL_DIAMOND_SIZE);
|
|
|
|
glEnd();
|
|
|
|
|
|
|
|
glBegin(GL_LINE_STRIP);
|
|
|
|
glVertex2f(0, FRL_DIAMOND_SIZE);
|
2006-06-14 12:49:27 +00:00
|
|
|
glVertex2f(0, 8.0);
|
2006-06-12 21:34:47 +00:00
|
|
|
glEnd();
|
The following changes were made to flightgear-0.7.5 code to implement the follow
ing features:
a) ADA Flight model - ADA.cxx, ADA.hxx, flight.hxx
b) Fighter a/c HUD - flight.hxx, hud.hxx, hud.cxx, cockpit.cxx, hud_ladr.c
xx, hud_card.cxx
c) 3-window display - options.hxx, options.cxx, viewer.cxx
d) Moving objects (ship) - main.cxx
e) Patches - main.cxx
ADA.cxx, ADA.hxx
--------------------------
Interface to the external ADA flight dynamics package.
flight.hxx
----------
Included prototypes for accepting additional data fron the External flight
model for fighter aircraft HUD
Hud.hxx
-------
Included prototypes for accepting additional data for fighter HUD from Exernal F
light model.
Defined FIGHTER_HUD pre-processor directive to enable compilation of fighter hud
code.
hud.cxx, cockpit.cxx, hud_ladr.cxx, hud_card.cxx
---------------------------------------
Included code to initialise additional reticles/text for fighter HUD which is co
nditionally
compiled if FIGHTER_HUD is defined.
options.hxx
-----------
Added window_offset, and function to retrieve its value for 3 windows
options.cxx
-----------
Changed few options to suit ADA/CEF projection system/screens and checks for win
dow offset.
views.cxx
---------
Added code to retrieve view offset for window.
Main.cxx
--------
Added code to load and move an aircraft carrier.
Patch to enable clouds from command line until Curtis fixes it. By default cloud
s are disabled.
2000-10-19 19:46:13 +00:00
|
|
|
#undef FRL_DIAMOND_SIZE
|
2001-01-05 16:44:48 +00:00
|
|
|
}
|
|
|
|
// TYPE WATERLINE_MARK (W shaped _ _ )
|
2006-06-12 21:34:47 +00:00
|
|
|
// \/\/
|
2001-01-05 16:44:48 +00:00
|
|
|
|
2006-06-12 21:34:47 +00:00
|
|
|
//****************************************************************
|
2001-01-05 16:44:48 +00:00
|
|
|
// TYPE TARGET_SPOT
|
|
|
|
// Draw the target spot.
|
2006-06-12 21:34:47 +00:00
|
|
|
if (target_spot) {
|
2001-01-05 16:44:48 +00:00
|
|
|
#define CENTER_DIAMOND_SIZE 6.0
|
2006-06-12 21:34:47 +00:00
|
|
|
glBegin(GL_LINE_LOOP);
|
2006-06-14 12:49:27 +00:00
|
|
|
glVertex2f(-CENTER_DIAMOND_SIZE, 0.0);
|
2006-06-12 21:34:47 +00:00
|
|
|
glVertex2f(0.0, CENTER_DIAMOND_SIZE);
|
2006-06-14 12:49:27 +00:00
|
|
|
glVertex2f(CENTER_DIAMOND_SIZE, 0.0);
|
2006-06-12 21:34:47 +00:00
|
|
|
glVertex2f(0.0, -CENTER_DIAMOND_SIZE);
|
|
|
|
glEnd();
|
2001-01-05 16:44:48 +00:00
|
|
|
#undef CENTER_DIAMOND_SIZE
|
|
|
|
}
|
The following changes were made to flightgear-0.7.5 code to implement the follow
ing features:
a) ADA Flight model - ADA.cxx, ADA.hxx, flight.hxx
b) Fighter a/c HUD - flight.hxx, hud.hxx, hud.cxx, cockpit.cxx, hud_ladr.c
xx, hud_card.cxx
c) 3-window display - options.hxx, options.cxx, viewer.cxx
d) Moving objects (ship) - main.cxx
e) Patches - main.cxx
ADA.cxx, ADA.hxx
--------------------------
Interface to the external ADA flight dynamics package.
flight.hxx
----------
Included prototypes for accepting additional data fron the External flight
model for fighter aircraft HUD
Hud.hxx
-------
Included prototypes for accepting additional data for fighter HUD from Exernal F
light model.
Defined FIGHTER_HUD pre-processor directive to enable compilation of fighter hud
code.
hud.cxx, cockpit.cxx, hud_ladr.cxx, hud_card.cxx
---------------------------------------
Included code to initialise additional reticles/text for fighter HUD which is co
nditionally
compiled if FIGHTER_HUD is defined.
options.hxx
-----------
Added window_offset, and function to retrieve its value for 3 windows
options.cxx
-----------
Changed few options to suit ADA/CEF projection system/screens and checks for win
dow offset.
views.cxx
---------
Added code to retrieve view offset for window.
Main.cxx
--------
Added code to load and move an aircraft carrier.
Patch to enable clouds from command line until Curtis fixes it. By default cloud
s are disabled.
2000-10-19 19:46:13 +00:00
|
|
|
|
2006-06-12 21:34:47 +00:00
|
|
|
//****************************************************************
|
2001-01-05 16:44:48 +00:00
|
|
|
//velocity vector reticle - computations
|
2006-06-12 21:34:47 +00:00
|
|
|
if (velocity_vector) {
|
|
|
|
Vxx = get_Vx();
|
|
|
|
Vyy = get_Vy();
|
|
|
|
Vzz = get_Vz();
|
|
|
|
Axx = get_Ax();
|
|
|
|
Ayy = get_Ay();
|
|
|
|
Azz = get_Az();
|
|
|
|
psi = get_heading();
|
|
|
|
|
|
|
|
if (psi > 180.0)
|
|
|
|
psi = psi - 360;
|
|
|
|
|
2006-06-14 12:49:27 +00:00
|
|
|
total_vel = sqrt(Vxx * Vxx + Vyy * Vyy + Vzz * Vzz);
|
|
|
|
ground_vel = sqrt(Vxx * Vxx + Vyy * Vyy);
|
2006-06-12 21:34:47 +00:00
|
|
|
up_vel = Vzz;
|
|
|
|
|
|
|
|
if (ground_vel < 2.0) {
|
|
|
|
if (fabs(up_vel) < 2.0)
|
|
|
|
actslope = 0.0;
|
|
|
|
else
|
2006-06-14 12:49:27 +00:00
|
|
|
actslope = (up_vel / fabs(up_vel)) * 90.0;
|
2006-06-12 21:34:47 +00:00
|
|
|
|
|
|
|
} else {
|
2006-06-14 12:49:27 +00:00
|
|
|
actslope = atan(up_vel / ground_vel) * SGD_RADIANS_TO_DEGREES;
|
2006-06-12 21:34:47 +00:00
|
|
|
}
|
|
|
|
|
2006-06-14 12:49:27 +00:00
|
|
|
xvvr = (((atan2(Vyy, Vxx) * SGD_RADIANS_TO_DEGREES) - psi)
|
|
|
|
* (factor / globals->get_current_view()->get_aspect_ratio()));
|
|
|
|
drift = ((atan2(Vyy, Vxx) * SGD_RADIANS_TO_DEGREES) - psi);
|
|
|
|
yvvr = ((actslope - pitch_value) * factor);
|
|
|
|
vel_y = ((actslope - pitch_value) * cos(roll_value) + drift * sin(roll_value)) * factor;
|
|
|
|
vel_x = (-(actslope - pitch_value) * sin(roll_value) + drift * cos(roll_value))
|
2006-06-12 21:34:47 +00:00
|
|
|
* (factor/globals->get_current_view()->get_aspect_ratio());
|
2006-06-14 12:49:27 +00:00
|
|
|
// printf("%f %f %f %f\n",vel_x, vel_y, drift, psi);
|
2006-06-12 21:34:47 +00:00
|
|
|
|
|
|
|
//****************************************************************
|
|
|
|
// OBJECT MOVING RETICLE
|
|
|
|
// TYPE - DRIFT MARKER
|
|
|
|
// ATTRIB - ALWAYS
|
|
|
|
// drift marker
|
|
|
|
if (drift_marker) {
|
|
|
|
glBegin(GL_LINE_STRIP);
|
2006-06-14 12:49:27 +00:00
|
|
|
glVertex2f((xvvr * 25 / 120) - 6, -4);
|
|
|
|
glVertex2f(xvvr * 25 / 120, 8);
|
|
|
|
glVertex2f((xvvr * 25 / 120) + 6, -4);
|
2006-06-12 21:34:47 +00:00
|
|
|
glEnd();
|
|
|
|
}
|
|
|
|
|
|
|
|
//****************************************************************
|
|
|
|
// Clipping coordinates for ladder to be input from xml file
|
|
|
|
// Clip hud ladder
|
|
|
|
if (clip_plane) {
|
2006-06-14 12:49:27 +00:00
|
|
|
glClipPlane(GL_CLIP_PLANE0, eqn_top);
|
2006-06-12 21:34:47 +00:00
|
|
|
glEnable(GL_CLIP_PLANE0);
|
2006-06-14 12:49:27 +00:00
|
|
|
glClipPlane(GL_CLIP_PLANE1, eqn_left);
|
2006-06-12 21:34:47 +00:00
|
|
|
glEnable(GL_CLIP_PLANE1);
|
2006-06-14 12:49:27 +00:00
|
|
|
glClipPlane(GL_CLIP_PLANE2, eqn_right);
|
2006-06-12 21:34:47 +00:00
|
|
|
glEnable(GL_CLIP_PLANE2);
|
2006-06-14 12:49:27 +00:00
|
|
|
// glScissor(-100,-240, 200, 240);
|
2006-06-12 21:34:47 +00:00
|
|
|
// glEnable(GL_SCISSOR_TEST);
|
|
|
|
}
|
|
|
|
|
|
|
|
//****************************************************************
|
|
|
|
// OBJECT MOVING RETICLE
|
|
|
|
// TYPE VELOCITY VECTOR
|
|
|
|
// ATTRIB - ALWAYS
|
|
|
|
// velocity vector
|
|
|
|
glBegin(GL_LINE_LOOP); // Use polygon to approximate a circle
|
2006-06-14 12:49:27 +00:00
|
|
|
for (count = 0; count < 50; count++) {
|
|
|
|
cosine = 6 * cos(count * SGD_2PI / 50.0);
|
|
|
|
sine = 6 * sin(count * SGD_2PI / 50.0);
|
|
|
|
glVertex2f(cosine + vel_x, sine + vel_y);
|
2006-06-12 21:34:47 +00:00
|
|
|
}
|
|
|
|
glEnd();
|
|
|
|
|
|
|
|
//velocity vector reticle orientation lines
|
|
|
|
glBegin(GL_LINE_STRIP);
|
2006-06-14 12:49:27 +00:00
|
|
|
glVertex2f(vel_x - 12, vel_y);
|
|
|
|
glVertex2f(vel_x - 6, vel_y);
|
2006-06-12 21:34:47 +00:00
|
|
|
glEnd();
|
|
|
|
glBegin(GL_LINE_STRIP);
|
2006-06-14 12:49:27 +00:00
|
|
|
glVertex2f(vel_x + 12, vel_y);
|
|
|
|
glVertex2f(vel_x + 6, vel_y);
|
2006-06-12 21:34:47 +00:00
|
|
|
glEnd();
|
|
|
|
glBegin(GL_LINE_STRIP);
|
2006-06-14 12:49:27 +00:00
|
|
|
glVertex2f(vel_x, vel_y + 12);
|
|
|
|
glVertex2f(vel_x, vel_y + 6);
|
2006-06-12 21:34:47 +00:00
|
|
|
glEnd();
|
2001-01-05 16:44:48 +00:00
|
|
|
|
2004-10-20 08:15:55 +00:00
|
|
|
#ifdef ENABLE_SP_FMDS
|
2006-06-12 21:34:47 +00:00
|
|
|
// OBJECT MOVING RETICLE
|
|
|
|
// TYPE LINE
|
|
|
|
// ATTRIB - ON CONDITION
|
|
|
|
if (lgear == 1) {
|
|
|
|
// undercarriage status
|
|
|
|
glBegin(GL_LINE_STRIP);
|
2006-06-14 12:49:27 +00:00
|
|
|
glVertex2f(vel_x + 8, vel_y);
|
|
|
|
glVertex2f(vel_x + 8, vel_y - 4);
|
2006-06-12 21:34:47 +00:00
|
|
|
glEnd();
|
|
|
|
|
|
|
|
// OBJECT MOVING RETICLE
|
|
|
|
// TYPE LINE
|
|
|
|
// ATTRIB - ON CONDITION
|
|
|
|
glBegin(GL_LINE_STRIP);
|
2006-06-14 12:49:27 +00:00
|
|
|
glVertex2f(vel_x - 8, vel_y);
|
|
|
|
glVertex2f(vel_x - 8, vel_y - 4);
|
2006-06-12 21:34:47 +00:00
|
|
|
glEnd();
|
|
|
|
|
|
|
|
// OBJECT MOVING RETICLE
|
|
|
|
// TYPE LINE
|
|
|
|
// ATTRIB - ON CONDITION
|
|
|
|
glBegin(GL_LINE_STRIP);
|
2006-06-14 12:49:27 +00:00
|
|
|
glVertex2f(vel_x, vel_y - 6);
|
|
|
|
glVertex2f(vel_x, vel_y - 10);
|
2006-06-12 21:34:47 +00:00
|
|
|
glEnd();
|
|
|
|
}
|
|
|
|
|
|
|
|
// OBJECT MOVING RETICLE
|
|
|
|
// TYPE V
|
|
|
|
// ATTRIB - ON CONDITION
|
|
|
|
if (ihook == 1) {
|
|
|
|
// arrestor hook status
|
|
|
|
glBegin(GL_LINE_STRIP);
|
2006-06-14 12:49:27 +00:00
|
|
|
glVertex2f(vel_x - 4, vel_y - 8);
|
|
|
|
glVertex2f(vel_x, vel_y - 10);
|
|
|
|
glVertex2f(vel_x + 4, vel_y - 8);
|
2006-06-12 21:34:47 +00:00
|
|
|
glEnd();
|
|
|
|
}
|
2004-10-20 08:15:55 +00:00
|
|
|
#endif
|
2006-06-12 21:34:47 +00:00
|
|
|
} // if velocity_vector
|
|
|
|
|
2001-01-05 16:44:48 +00:00
|
|
|
|
|
|
|
//***************************************************************
|
|
|
|
// OBJECT MOVING RETICLE
|
|
|
|
// TYPE - SQUARE_BRACKET
|
|
|
|
// ATTRIB - ON CONDITION
|
|
|
|
// alpha bracket
|
2004-10-20 08:15:55 +00:00
|
|
|
#ifdef ENABLE_SP_FMDS
|
2006-06-12 21:34:47 +00:00
|
|
|
if (alpha_bracket && ihook == 1) {
|
|
|
|
glBegin(GL_LINE_STRIP);
|
2006-06-14 12:49:27 +00:00
|
|
|
glVertex2f(vel_x - 20 , vel_y - (16 - alpha) * factor);
|
|
|
|
glVertex2f(vel_x - 17, vel_y - (16 - alpha) * factor);
|
|
|
|
glVertex2f(vel_x - 17, vel_y - (14 - alpha) * factor);
|
|
|
|
glVertex2f(vel_x - 20, vel_y - (14 - alpha) * factor);
|
2006-06-12 21:34:47 +00:00
|
|
|
glEnd();
|
|
|
|
|
|
|
|
glBegin(GL_LINE_STRIP);
|
2006-06-14 12:49:27 +00:00
|
|
|
glVertex2f(vel_x + 20 , vel_y - (16 - alpha) * factor);
|
|
|
|
glVertex2f(vel_x + 17, vel_y - (16 - alpha) * factor);
|
|
|
|
glVertex2f(vel_x + 17, vel_y - (14 - alpha) * factor);
|
|
|
|
glVertex2f(vel_x + 20, vel_y - (14 - alpha) * factor);
|
2006-06-12 21:34:47 +00:00
|
|
|
glEnd();
|
2001-01-05 16:44:48 +00:00
|
|
|
}
|
2004-10-20 08:15:55 +00:00
|
|
|
#endif
|
2006-06-14 12:49:27 +00:00
|
|
|
//printf("xvr=%f, yvr=%f, Vx=%f, Vy=%f, Vz=%f\n",xvvr, yvvr, Vx, Vy, Vz);
|
|
|
|
//printf("Ax=%f, Ay=%f, Az=%f\n",Ax, Ay, Az);
|
2006-06-12 21:34:47 +00:00
|
|
|
|
|
|
|
//****************************************************************
|
2001-01-05 16:44:48 +00:00
|
|
|
// OBJECT MOVING RETICLE
|
|
|
|
// TYPE ENERGY_MARKERS
|
|
|
|
// ATTRIB - ALWAYS
|
The following changes were made to flightgear-0.7.5 code to implement the follow
ing features:
a) ADA Flight model - ADA.cxx, ADA.hxx, flight.hxx
b) Fighter a/c HUD - flight.hxx, hud.hxx, hud.cxx, cockpit.cxx, hud_ladr.c
xx, hud_card.cxx
c) 3-window display - options.hxx, options.cxx, viewer.cxx
d) Moving objects (ship) - main.cxx
e) Patches - main.cxx
ADA.cxx, ADA.hxx
--------------------------
Interface to the external ADA flight dynamics package.
flight.hxx
----------
Included prototypes for accepting additional data fron the External flight
model for fighter aircraft HUD
Hud.hxx
-------
Included prototypes for accepting additional data for fighter HUD from Exernal F
light model.
Defined FIGHTER_HUD pre-processor directive to enable compilation of fighter hud
code.
hud.cxx, cockpit.cxx, hud_ladr.cxx, hud_card.cxx
---------------------------------------
Included code to initialise additional reticles/text for fighter HUD which is co
nditionally
compiled if FIGHTER_HUD is defined.
options.hxx
-----------
Added window_offset, and function to retrieve its value for 3 windows
options.cxx
-----------
Changed few options to suit ADA/CEF projection system/screens and checks for win
dow offset.
views.cxx
---------
Added code to retrieve view offset for window.
Main.cxx
--------
Added code to load and move an aircraft carrier.
Patch to enable clouds from command line until Curtis fixes it. By default cloud
s are disabled.
2000-10-19 19:46:13 +00:00
|
|
|
//energy markers - compute potential slope
|
2006-06-12 21:34:47 +00:00
|
|
|
if (energy_marker) {
|
|
|
|
if (total_vel < 5.0) {
|
|
|
|
t1 = 0;
|
|
|
|
t2 = 0;
|
|
|
|
} else {
|
2006-06-14 12:49:27 +00:00
|
|
|
t1 = up_vel / total_vel;
|
|
|
|
t2 = asin((Vxx * Axx + Vyy * Ayy + Vzz * Azz) / (9.81 * total_vel));
|
2006-06-12 21:34:47 +00:00
|
|
|
}
|
2006-06-14 12:49:27 +00:00
|
|
|
pot_slope = ((t2 / 3) * SGD_RADIANS_TO_DEGREES) * factor + vel_y;
|
|
|
|
// if (pot_slope < (vel_y - 45)) pot_slope = vel_y - 45;
|
|
|
|
// if (pot_slope > (vel_y + 45)) pot_slope = vel_y + 45;
|
2006-06-12 21:34:47 +00:00
|
|
|
|
|
|
|
//energy markers
|
|
|
|
glBegin(GL_LINE_STRIP);
|
2006-06-14 12:49:27 +00:00
|
|
|
glVertex2f(vel_x - 20, pot_slope - 5);
|
|
|
|
glVertex2f(vel_x - 15, pot_slope);
|
|
|
|
glVertex2f(vel_x - 20, pot_slope + 5);
|
2006-06-12 21:34:47 +00:00
|
|
|
glEnd();
|
|
|
|
|
|
|
|
glBegin(GL_LINE_STRIP);
|
2006-06-14 12:49:27 +00:00
|
|
|
glVertex2f(vel_x + 20, pot_slope - 5);
|
|
|
|
glVertex2f(vel_x + 15, pot_slope);
|
|
|
|
glVertex2f(vel_x + 20, pot_slope + 5);
|
2006-06-12 21:34:47 +00:00
|
|
|
glEnd();
|
|
|
|
|
2006-06-14 12:49:27 +00:00
|
|
|
if (pla > (105.0 / 131.0)) {
|
2006-06-12 21:34:47 +00:00
|
|
|
glBegin(GL_LINE_STRIP);
|
2006-06-14 12:49:27 +00:00
|
|
|
glVertex2f(vel_x - 24, pot_slope - 5);
|
|
|
|
glVertex2f(vel_x - 19, pot_slope);
|
|
|
|
glVertex2f(vel_x - 24, pot_slope + 5);
|
2006-06-12 21:34:47 +00:00
|
|
|
glEnd();
|
|
|
|
|
|
|
|
glBegin(GL_LINE_STRIP);
|
2006-06-14 12:49:27 +00:00
|
|
|
glVertex2f(vel_x + 24, pot_slope - 5);
|
|
|
|
glVertex2f(vel_x + 19, pot_slope);
|
|
|
|
glVertex2f(vel_x + 24, pot_slope + 5);
|
2006-06-12 21:34:47 +00:00
|
|
|
glEnd();
|
|
|
|
}
|
The following changes were made to flightgear-0.7.5 code to implement the follow
ing features:
a) ADA Flight model - ADA.cxx, ADA.hxx, flight.hxx
b) Fighter a/c HUD - flight.hxx, hud.hxx, hud.cxx, cockpit.cxx, hud_ladr.c
xx, hud_card.cxx
c) 3-window display - options.hxx, options.cxx, viewer.cxx
d) Moving objects (ship) - main.cxx
e) Patches - main.cxx
ADA.cxx, ADA.hxx
--------------------------
Interface to the external ADA flight dynamics package.
flight.hxx
----------
Included prototypes for accepting additional data fron the External flight
model for fighter aircraft HUD
Hud.hxx
-------
Included prototypes for accepting additional data for fighter HUD from Exernal F
light model.
Defined FIGHTER_HUD pre-processor directive to enable compilation of fighter hud
code.
hud.cxx, cockpit.cxx, hud_ladr.cxx, hud_card.cxx
---------------------------------------
Included code to initialise additional reticles/text for fighter HUD which is co
nditionally
compiled if FIGHTER_HUD is defined.
options.hxx
-----------
Added window_offset, and function to retrieve its value for 3 windows
options.cxx
-----------
Changed few options to suit ADA/CEF projection system/screens and checks for win
dow offset.
views.cxx
---------
Added code to retrieve view offset for window.
Main.cxx
--------
Added code to load and move an aircraft carrier.
Patch to enable clouds from command line until Curtis fixes it. By default cloud
s are disabled.
2000-10-19 19:46:13 +00:00
|
|
|
}
|
2006-06-12 21:34:47 +00:00
|
|
|
|
|
|
|
//**********************************************************
|
2001-01-05 16:44:48 +00:00
|
|
|
// ramp reticle
|
|
|
|
// OBJECT STATIC RETICLE
|
|
|
|
// TYPE LINE
|
|
|
|
// ATTRIB - ON CONDITION
|
2004-10-20 08:15:55 +00:00
|
|
|
#ifdef ENABLE_SP_FMDS
|
2006-06-12 21:34:47 +00:00
|
|
|
if (energy_worm && ilcanclaw == 1) {
|
|
|
|
glBegin(GL_LINE_STRIP);
|
|
|
|
glVertex2f(-15, -134);
|
|
|
|
glVertex2f(15, -134);
|
|
|
|
glEnd();
|
|
|
|
|
|
|
|
// OBJECT MOVING RETICLE
|
|
|
|
// TYPE BOX
|
|
|
|
// ATTRIB - ON CONDITION
|
|
|
|
glBegin(GL_LINE_STRIP);
|
|
|
|
glVertex2f(-6, -134);
|
2006-06-14 12:49:27 +00:00
|
|
|
glVertex2f(-6, t2 * SGD_RADIANS_TO_DEGREES * 4.0 - 134);
|
|
|
|
glVertex2f(+6, t2 * SGD_RADIANS_TO_DEGREES * 4.0 - 134);
|
2006-06-12 21:34:47 +00:00
|
|
|
glVertex2f(6, -134);
|
|
|
|
glEnd();
|
|
|
|
|
|
|
|
// OBJECT MOVING RETICLE
|
|
|
|
// TYPE DIAMOND
|
|
|
|
// ATTRIB - ON CONDITION
|
|
|
|
glBegin(GL_LINE_LOOP);
|
2006-06-14 12:49:27 +00:00
|
|
|
glVertex2f(-6, actslope * 4.0 - 134);
|
|
|
|
glVertex2f(0, actslope * 4.0 -134 + 3);
|
|
|
|
glVertex2f(6, actslope * 4.0 - 134);
|
|
|
|
glVertex2f(0, actslope * 4.0 -134 -3);
|
2006-06-12 21:34:47 +00:00
|
|
|
glEnd();
|
The following changes were made to flightgear-0.7.5 code to implement the follow
ing features:
a) ADA Flight model - ADA.cxx, ADA.hxx, flight.hxx
b) Fighter a/c HUD - flight.hxx, hud.hxx, hud.cxx, cockpit.cxx, hud_ladr.c
xx, hud_card.cxx
c) 3-window display - options.hxx, options.cxx, viewer.cxx
d) Moving objects (ship) - main.cxx
e) Patches - main.cxx
ADA.cxx, ADA.hxx
--------------------------
Interface to the external ADA flight dynamics package.
flight.hxx
----------
Included prototypes for accepting additional data fron the External flight
model for fighter aircraft HUD
Hud.hxx
-------
Included prototypes for accepting additional data for fighter HUD from Exernal F
light model.
Defined FIGHTER_HUD pre-processor directive to enable compilation of fighter hud
code.
hud.cxx, cockpit.cxx, hud_ladr.cxx, hud_card.cxx
---------------------------------------
Included code to initialise additional reticles/text for fighter HUD which is co
nditionally
compiled if FIGHTER_HUD is defined.
options.hxx
-----------
Added window_offset, and function to retrieve its value for 3 windows
options.cxx
-----------
Changed few options to suit ADA/CEF projection system/screens and checks for win
dow offset.
views.cxx
---------
Added code to retrieve view offset for window.
Main.cxx
--------
Added code to load and move an aircraft carrier.
Patch to enable clouds from command line until Curtis fixes it. By default cloud
s are disabled.
2000-10-19 19:46:13 +00:00
|
|
|
}
|
2004-10-20 08:15:55 +00:00
|
|
|
#endif
|
2006-06-12 21:34:47 +00:00
|
|
|
|
2001-01-05 16:44:48 +00:00
|
|
|
//*************************************************************
|
|
|
|
// OBJECT MOVING RETICLE
|
|
|
|
// TYPE DIAMOND
|
|
|
|
// ATTRIB - ALWAYS
|
The following changes were made to flightgear-0.7.5 code to implement the follow
ing features:
a) ADA Flight model - ADA.cxx, ADA.hxx, flight.hxx
b) Fighter a/c HUD - flight.hxx, hud.hxx, hud.cxx, cockpit.cxx, hud_ladr.c
xx, hud_card.cxx
c) 3-window display - options.hxx, options.cxx, viewer.cxx
d) Moving objects (ship) - main.cxx
e) Patches - main.cxx
ADA.cxx, ADA.hxx
--------------------------
Interface to the external ADA flight dynamics package.
flight.hxx
----------
Included prototypes for accepting additional data fron the External flight
model for fighter aircraft HUD
Hud.hxx
-------
Included prototypes for accepting additional data for fighter HUD from Exernal F
light model.
Defined FIGHTER_HUD pre-processor directive to enable compilation of fighter hud
code.
hud.cxx, cockpit.cxx, hud_ladr.cxx, hud_card.cxx
---------------------------------------
Included code to initialise additional reticles/text for fighter HUD which is co
nditionally
compiled if FIGHTER_HUD is defined.
options.hxx
-----------
Added window_offset, and function to retrieve its value for 3 windows
options.cxx
-----------
Changed few options to suit ADA/CEF projection system/screens and checks for win
dow offset.
views.cxx
---------
Added code to retrieve view offset for window.
Main.cxx
--------
Added code to load and move an aircraft carrier.
Patch to enable clouds from command line until Curtis fixes it. By default cloud
s are disabled.
2000-10-19 19:46:13 +00:00
|
|
|
// Draw the locked velocity vector.
|
2006-06-12 21:34:47 +00:00
|
|
|
if (climb_dive_marker) {
|
|
|
|
glBegin(GL_LINE_LOOP);
|
2006-06-14 12:49:27 +00:00
|
|
|
glVertex2f(-3.0, 0.0 + vel_y);
|
|
|
|
glVertex2f(0.0, 6.0 + vel_y);
|
|
|
|
glVertex2f(3.0, 0.0 + vel_y);
|
|
|
|
glVertex2f(0.0, -6.0 + vel_y);
|
2006-06-12 21:34:47 +00:00
|
|
|
glEnd();
|
The following changes were made to flightgear-0.7.5 code to implement the follow
ing features:
a) ADA Flight model - ADA.cxx, ADA.hxx, flight.hxx
b) Fighter a/c HUD - flight.hxx, hud.hxx, hud.cxx, cockpit.cxx, hud_ladr.c
xx, hud_card.cxx
c) 3-window display - options.hxx, options.cxx, viewer.cxx
d) Moving objects (ship) - main.cxx
e) Patches - main.cxx
ADA.cxx, ADA.hxx
--------------------------
Interface to the external ADA flight dynamics package.
flight.hxx
----------
Included prototypes for accepting additional data fron the External flight
model for fighter aircraft HUD
Hud.hxx
-------
Included prototypes for accepting additional data for fighter HUD from Exernal F
light model.
Defined FIGHTER_HUD pre-processor directive to enable compilation of fighter hud
code.
hud.cxx, cockpit.cxx, hud_ladr.cxx, hud_card.cxx
---------------------------------------
Included code to initialise additional reticles/text for fighter HUD which is co
nditionally
compiled if FIGHTER_HUD is defined.
options.hxx
-----------
Added window_offset, and function to retrieve its value for 3 windows
options.cxx
-----------
Changed few options to suit ADA/CEF projection system/screens and checks for win
dow offset.
views.cxx
---------
Added code to retrieve view offset for window.
Main.cxx
--------
Added code to load and move an aircraft carrier.
Patch to enable clouds from command line until Curtis fixes it. By default cloud
s are disabled.
2000-10-19 19:46:13 +00:00
|
|
|
}
|
|
|
|
|
2006-06-12 21:34:47 +00:00
|
|
|
//****************************************************************
|
2001-01-05 16:44:48 +00:00
|
|
|
|
2006-06-12 21:34:47 +00:00
|
|
|
if (climb_dive_ladder) { // CONFORMAL_HUD
|
|
|
|
vmin = pitch_value - (float)width_units;
|
|
|
|
vmax = pitch_value + (float)width_units;
|
2006-06-14 12:49:27 +00:00
|
|
|
glTranslatef(vel_x, vel_y, 0);
|
2001-01-05 16:44:48 +00:00
|
|
|
|
2006-06-12 21:34:47 +00:00
|
|
|
} else { // pitch_ladder - Default Hud
|
|
|
|
vmin = pitch_value - (float)width_units * 0.5f;
|
|
|
|
vmax = pitch_value + (float)width_units * 0.5f;
|
The following changes were made to flightgear-0.7.5 code to implement the follow
ing features:
a) ADA Flight model - ADA.cxx, ADA.hxx, flight.hxx
b) Fighter a/c HUD - flight.hxx, hud.hxx, hud.cxx, cockpit.cxx, hud_ladr.c
xx, hud_card.cxx
c) 3-window display - options.hxx, options.cxx, viewer.cxx
d) Moving objects (ship) - main.cxx
e) Patches - main.cxx
ADA.cxx, ADA.hxx
--------------------------
Interface to the external ADA flight dynamics package.
flight.hxx
----------
Included prototypes for accepting additional data fron the External flight
model for fighter aircraft HUD
Hud.hxx
-------
Included prototypes for accepting additional data for fighter HUD from Exernal F
light model.
Defined FIGHTER_HUD pre-processor directive to enable compilation of fighter hud
code.
hud.cxx, cockpit.cxx, hud_ladr.cxx, hud_card.cxx
---------------------------------------
Included code to initialise additional reticles/text for fighter HUD which is co
nditionally
compiled if FIGHTER_HUD is defined.
options.hxx
-----------
Added window_offset, and function to retrieve its value for 3 windows
options.cxx
-----------
Changed few options to suit ADA/CEF projection system/screens and checks for win
dow offset.
views.cxx
---------
Added code to retrieve view offset for window.
Main.cxx
--------
Added code to load and move an aircraft carrier.
Patch to enable clouds from command line until Curtis fixes it. By default cloud
s are disabled.
2000-10-19 19:46:13 +00:00
|
|
|
}
|
|
|
|
|
2001-03-24 04:48:44 +00:00
|
|
|
glRotatef(roll_value * SGD_RADIANS_TO_DEGREES, 0.0, 0.0, 1.0);
|
2001-01-05 16:44:48 +00:00
|
|
|
// FRL marker not rotated - this line shifted below
|
The following changes were made to flightgear-0.7.5 code to implement the follow
ing features:
a) ADA Flight model - ADA.cxx, ADA.hxx, flight.hxx
b) Fighter a/c HUD - flight.hxx, hud.hxx, hud.cxx, cockpit.cxx, hud_ladr.c
xx, hud_card.cxx
c) 3-window display - options.hxx, options.cxx, viewer.cxx
d) Moving objects (ship) - main.cxx
e) Patches - main.cxx
ADA.cxx, ADA.hxx
--------------------------
Interface to the external ADA flight dynamics package.
flight.hxx
----------
Included prototypes for accepting additional data fron the External flight
model for fighter aircraft HUD
Hud.hxx
-------
Included prototypes for accepting additional data for fighter HUD from Exernal F
light model.
Defined FIGHTER_HUD pre-processor directive to enable compilation of fighter hud
code.
hud.cxx, cockpit.cxx, hud_ladr.cxx, hud_card.cxx
---------------------------------------
Included code to initialise additional reticles/text for fighter HUD which is co
nditionally
compiled if FIGHTER_HUD is defined.
options.hxx
-----------
Added window_offset, and function to retrieve its value for 3 windows
options.cxx
-----------
Changed few options to suit ADA/CEF projection system/screens and checks for win
dow offset.
views.cxx
---------
Added code to retrieve view offset for window.
Main.cxx
--------
Added code to load and move an aircraft carrier.
Patch to enable clouds from command line until Curtis fixes it. By default cloud
s are disabled.
2000-10-19 19:46:13 +00:00
|
|
|
|
2006-06-12 21:34:47 +00:00
|
|
|
if (div_units) {
|
|
|
|
char TextLadder[8];
|
|
|
|
float label_length;
|
|
|
|
float label_height;
|
|
|
|
float left;
|
|
|
|
float right;
|
|
|
|
float bot;
|
|
|
|
float top;
|
|
|
|
float text_offset = 4.0f;
|
|
|
|
float zero_offset = 0.0;
|
|
|
|
|
|
|
|
if (climb_dive_ladder)
|
|
|
|
zero_offset = 50.0f; // horizon line is wider by this much (hard coded ??)
|
|
|
|
else
|
|
|
|
zero_offset = 10.0f;
|
|
|
|
|
2006-06-14 12:49:27 +00:00
|
|
|
fntFont *font = HUDtext->getFont(); // FIXME
|
|
|
|
float pointsize = HUDtext->getPointSize();
|
|
|
|
float italic = HUDtext->getSlant();
|
2006-06-12 21:34:47 +00:00
|
|
|
|
2006-06-14 12:49:27 +00:00
|
|
|
TextList.setFont(HUDtext);
|
2006-06-12 21:34:47 +00:00
|
|
|
TextList.erase();
|
|
|
|
LineList.erase();
|
|
|
|
StippleLineList.erase();
|
|
|
|
|
2006-06-14 12:49:27 +00:00
|
|
|
int last = FloatToInt(vmax) + 1;
|
|
|
|
int i = FloatToInt(vmin);
|
2006-06-12 21:34:47 +00:00
|
|
|
|
2006-06-14 12:49:27 +00:00
|
|
|
if (!scr_hole) {
|
|
|
|
x_end = half_span;
|
2006-06-12 21:34:47 +00:00
|
|
|
|
|
|
|
for (; i<last; i++) {
|
|
|
|
y = (((float)(i - pitch_value) * factor) + .5f);
|
|
|
|
|
2006-06-14 12:49:27 +00:00
|
|
|
if (!(i % div_units)) { // At integral multiple of div
|
|
|
|
sprintf(TextLadder, "%d", i);
|
|
|
|
font->getBBox(TextLadder, pointsize, italic,
|
|
|
|
&left, &right, &bot, &top);
|
|
|
|
label_length = right - left;
|
The following changes were made to flightgear-0.7.5 code to implement the follow
ing features:
a) ADA Flight model - ADA.cxx, ADA.hxx, flight.hxx
b) Fighter a/c HUD - flight.hxx, hud.hxx, hud.cxx, cockpit.cxx, hud_ladr.c
xx, hud_card.cxx
c) 3-window display - options.hxx, options.cxx, viewer.cxx
d) Moving objects (ship) - main.cxx
e) Patches - main.cxx
ADA.cxx, ADA.hxx
--------------------------
Interface to the external ADA flight dynamics package.
flight.hxx
----------
Included prototypes for accepting additional data fron the External flight
model for fighter aircraft HUD
Hud.hxx
-------
Included prototypes for accepting additional data for fighter HUD from Exernal F
light model.
Defined FIGHTER_HUD pre-processor directive to enable compilation of fighter hud
code.
hud.cxx, cockpit.cxx, hud_ladr.cxx, hud_card.cxx
---------------------------------------
Included code to initialise additional reticles/text for fighter HUD which is co
nditionally
compiled if FIGHTER_HUD is defined.
options.hxx
-----------
Added window_offset, and function to retrieve its value for 3 windows
options.cxx
-----------
Changed few options to suit ADA/CEF projection system/screens and checks for win
dow offset.
views.cxx
---------
Added code to retrieve view offset for window.
Main.cxx
--------
Added code to load and move an aircraft carrier.
Patch to enable clouds from command line until Curtis fixes it. By default cloud
s are disabled.
2000-10-19 19:46:13 +00:00
|
|
|
label_length += text_offset;
|
2006-06-14 12:49:27 +00:00
|
|
|
label_height = (top - bot) / 2.0f;
|
2006-06-12 21:34:47 +00:00
|
|
|
|
The following changes were made to flightgear-0.7.5 code to implement the follow
ing features:
a) ADA Flight model - ADA.cxx, ADA.hxx, flight.hxx
b) Fighter a/c HUD - flight.hxx, hud.hxx, hud.cxx, cockpit.cxx, hud_ladr.c
xx, hud_card.cxx
c) 3-window display - options.hxx, options.cxx, viewer.cxx
d) Moving objects (ship) - main.cxx
e) Patches - main.cxx
ADA.cxx, ADA.hxx
--------------------------
Interface to the external ADA flight dynamics package.
flight.hxx
----------
Included prototypes for accepting additional data fron the External flight
model for fighter aircraft HUD
Hud.hxx
-------
Included prototypes for accepting additional data for fighter HUD from Exernal F
light model.
Defined FIGHTER_HUD pre-processor directive to enable compilation of fighter hud
code.
hud.cxx, cockpit.cxx, hud_ladr.cxx, hud_card.cxx
---------------------------------------
Included code to initialise additional reticles/text for fighter HUD which is co
nditionally
compiled if FIGHTER_HUD is defined.
options.hxx
-----------
Added window_offset, and function to retrieve its value for 3 windows
options.cxx
-----------
Changed few options to suit ADA/CEF projection system/screens and checks for win
dow offset.
views.cxx
---------
Added code to retrieve view offset for window.
Main.cxx
--------
Added code to load and move an aircraft carrier.
Patch to enable clouds from command line until Curtis fixes it. By default cloud
s are disabled.
2000-10-19 19:46:13 +00:00
|
|
|
x_ini = -half_span;
|
2006-06-12 21:34:47 +00:00
|
|
|
|
2006-06-14 12:49:27 +00:00
|
|
|
if (i >= 0) {
|
The following changes were made to flightgear-0.7.5 code to implement the follow
ing features:
a) ADA Flight model - ADA.cxx, ADA.hxx, flight.hxx
b) Fighter a/c HUD - flight.hxx, hud.hxx, hud.cxx, cockpit.cxx, hud_ladr.c
xx, hud_card.cxx
c) 3-window display - options.hxx, options.cxx, viewer.cxx
d) Moving objects (ship) - main.cxx
e) Patches - main.cxx
ADA.cxx, ADA.hxx
--------------------------
Interface to the external ADA flight dynamics package.
flight.hxx
----------
Included prototypes for accepting additional data fron the External flight
model for fighter aircraft HUD
Hud.hxx
-------
Included prototypes for accepting additional data for fighter HUD from Exernal F
light model.
Defined FIGHTER_HUD pre-processor directive to enable compilation of fighter hud
code.
hud.cxx, cockpit.cxx, hud_ladr.cxx, hud_card.cxx
---------------------------------------
Included code to initialise additional reticles/text for fighter HUD which is co
nditionally
compiled if FIGHTER_HUD is defined.
options.hxx
-----------
Added window_offset, and function to retrieve its value for 3 windows
options.cxx
-----------
Changed few options to suit ADA/CEF projection system/screens and checks for win
dow offset.
views.cxx
---------
Added code to retrieve view offset for window.
Main.cxx
--------
Added code to load and move an aircraft carrier.
Patch to enable clouds from command line until Curtis fixes it. By default cloud
s are disabled.
2000-10-19 19:46:13 +00:00
|
|
|
// Make zero point wider on left
|
2006-06-14 12:49:27 +00:00
|
|
|
if (i == 0)
|
The following changes were made to flightgear-0.7.5 code to implement the follow
ing features:
a) ADA Flight model - ADA.cxx, ADA.hxx, flight.hxx
b) Fighter a/c HUD - flight.hxx, hud.hxx, hud.cxx, cockpit.cxx, hud_ladr.c
xx, hud_card.cxx
c) 3-window display - options.hxx, options.cxx, viewer.cxx
d) Moving objects (ship) - main.cxx
e) Patches - main.cxx
ADA.cxx, ADA.hxx
--------------------------
Interface to the external ADA flight dynamics package.
flight.hxx
----------
Included prototypes for accepting additional data fron the External flight
model for fighter aircraft HUD
Hud.hxx
-------
Included prototypes for accepting additional data for fighter HUD from Exernal F
light model.
Defined FIGHTER_HUD pre-processor directive to enable compilation of fighter hud
code.
hud.cxx, cockpit.cxx, hud_ladr.cxx, hud_card.cxx
---------------------------------------
Included code to initialise additional reticles/text for fighter HUD which is co
nditionally
compiled if FIGHTER_HUD is defined.
options.hxx
-----------
Added window_offset, and function to retrieve its value for 3 windows
options.cxx
-----------
Changed few options to suit ADA/CEF projection system/screens and checks for win
dow offset.
views.cxx
---------
Added code to retrieve view offset for window.
Main.cxx
--------
Added code to load and move an aircraft carrier.
Patch to enable clouds from command line until Curtis fixes it. By default cloud
s are disabled.
2000-10-19 19:46:13 +00:00
|
|
|
x_ini -= zero_offset;
|
2006-06-12 21:34:47 +00:00
|
|
|
|
|
|
|
// Zero or above draw solid lines
|
|
|
|
Line(x_ini, y, x_end, y);
|
|
|
|
|
|
|
|
if (i == 90 && zenith == 1)
|
2006-06-14 12:49:27 +00:00
|
|
|
drawZenith(x_ini, x_end, y);
|
The following changes were made to flightgear-0.7.5 code to implement the follow
ing features:
a) ADA Flight model - ADA.cxx, ADA.hxx, flight.hxx
b) Fighter a/c HUD - flight.hxx, hud.hxx, hud.cxx, cockpit.cxx, hud_ladr.c
xx, hud_card.cxx
c) 3-window display - options.hxx, options.cxx, viewer.cxx
d) Moving objects (ship) - main.cxx
e) Patches - main.cxx
ADA.cxx, ADA.hxx
--------------------------
Interface to the external ADA flight dynamics package.
flight.hxx
----------
Included prototypes for accepting additional data fron the External flight
model for fighter aircraft HUD
Hud.hxx
-------
Included prototypes for accepting additional data for fighter HUD from Exernal F
light model.
Defined FIGHTER_HUD pre-processor directive to enable compilation of fighter hud
code.
hud.cxx, cockpit.cxx, hud_ladr.cxx, hud_card.cxx
---------------------------------------
Included code to initialise additional reticles/text for fighter HUD which is co
nditionally
compiled if FIGHTER_HUD is defined.
options.hxx
-----------
Added window_offset, and function to retrieve its value for 3 windows
options.cxx
-----------
Changed few options to suit ADA/CEF projection system/screens and checks for win
dow offset.
views.cxx
---------
Added code to retrieve view offset for window.
Main.cxx
--------
Added code to load and move an aircraft carrier.
Patch to enable clouds from command line until Curtis fixes it. By default cloud
s are disabled.
2000-10-19 19:46:13 +00:00
|
|
|
} else {
|
|
|
|
// Below zero draw dashed lines.
|
|
|
|
StippleLine(x_ini, y, x_end, y);
|
2001-09-19 22:23:25 +00:00
|
|
|
|
2006-06-12 21:34:47 +00:00
|
|
|
if (i == -90 && nadir ==1)
|
2006-06-14 12:49:27 +00:00
|
|
|
drawNadir(x_ini, x_end, y);
|
The following changes were made to flightgear-0.7.5 code to implement the follow
ing features:
a) ADA Flight model - ADA.cxx, ADA.hxx, flight.hxx
b) Fighter a/c HUD - flight.hxx, hud.hxx, hud.cxx, cockpit.cxx, hud_ladr.c
xx, hud_card.cxx
c) 3-window display - options.hxx, options.cxx, viewer.cxx
d) Moving objects (ship) - main.cxx
e) Patches - main.cxx
ADA.cxx, ADA.hxx
--------------------------
Interface to the external ADA flight dynamics package.
flight.hxx
----------
Included prototypes for accepting additional data fron the External flight
model for fighter aircraft HUD
Hud.hxx
-------
Included prototypes for accepting additional data for fighter HUD from Exernal F
light model.
Defined FIGHTER_HUD pre-processor directive to enable compilation of fighter hud
code.
hud.cxx, cockpit.cxx, hud_ladr.cxx, hud_card.cxx
---------------------------------------
Included code to initialise additional reticles/text for fighter HUD which is co
nditionally
compiled if FIGHTER_HUD is defined.
options.hxx
-----------
Added window_offset, and function to retrieve its value for 3 windows
options.cxx
-----------
Changed few options to suit ADA/CEF projection system/screens and checks for win
dow offset.
views.cxx
---------
Added code to retrieve view offset for window.
Main.cxx
--------
Added code to load and move an aircraft carrier.
Patch to enable clouds from command line until Curtis fixes it. By default cloud
s are disabled.
2000-10-19 19:46:13 +00:00
|
|
|
}
|
2006-06-12 21:34:47 +00:00
|
|
|
|
The following changes were made to flightgear-0.7.5 code to implement the follow
ing features:
a) ADA Flight model - ADA.cxx, ADA.hxx, flight.hxx
b) Fighter a/c HUD - flight.hxx, hud.hxx, hud.cxx, cockpit.cxx, hud_ladr.c
xx, hud_card.cxx
c) 3-window display - options.hxx, options.cxx, viewer.cxx
d) Moving objects (ship) - main.cxx
e) Patches - main.cxx
ADA.cxx, ADA.hxx
--------------------------
Interface to the external ADA flight dynamics package.
flight.hxx
----------
Included prototypes for accepting additional data fron the External flight
model for fighter aircraft HUD
Hud.hxx
-------
Included prototypes for accepting additional data for fighter HUD from Exernal F
light model.
Defined FIGHTER_HUD pre-processor directive to enable compilation of fighter hud
code.
hud.cxx, cockpit.cxx, hud_ladr.cxx, hud_card.cxx
---------------------------------------
Included code to initialise additional reticles/text for fighter HUD which is co
nditionally
compiled if FIGHTER_HUD is defined.
options.hxx
-----------
Added window_offset, and function to retrieve its value for 3 windows
options.cxx
-----------
Changed few options to suit ADA/CEF projection system/screens and checks for win
dow offset.
views.cxx
---------
Added code to retrieve view offset for window.
Main.cxx
--------
Added code to load and move an aircraft carrier.
Patch to enable clouds from command line until Curtis fixes it. By default cloud
s are disabled.
2000-10-19 19:46:13 +00:00
|
|
|
// Calculate the position of the left text and write it.
|
2006-06-14 12:49:27 +00:00
|
|
|
Text(x_ini-label_length, y-label_height, TextLadder);
|
|
|
|
Text(x_end+text_offset, y-label_height, TextLadder);
|
The following changes were made to flightgear-0.7.5 code to implement the follow
ing features:
a) ADA Flight model - ADA.cxx, ADA.hxx, flight.hxx
b) Fighter a/c HUD - flight.hxx, hud.hxx, hud.cxx, cockpit.cxx, hud_ladr.c
xx, hud_card.cxx
c) 3-window display - options.hxx, options.cxx, viewer.cxx
d) Moving objects (ship) - main.cxx
e) Patches - main.cxx
ADA.cxx, ADA.hxx
--------------------------
Interface to the external ADA flight dynamics package.
flight.hxx
----------
Included prototypes for accepting additional data fron the External flight
model for fighter aircraft HUD
Hud.hxx
-------
Included prototypes for accepting additional data for fighter HUD from Exernal F
light model.
Defined FIGHTER_HUD pre-processor directive to enable compilation of fighter hud
code.
hud.cxx, cockpit.cxx, hud_ladr.cxx, hud_card.cxx
---------------------------------------
Included code to initialise additional reticles/text for fighter HUD which is co
nditionally
compiled if FIGHTER_HUD is defined.
options.hxx
-----------
Added window_offset, and function to retrieve its value for 3 windows
options.cxx
-----------
Changed few options to suit ADA/CEF projection system/screens and checks for win
dow offset.
views.cxx
---------
Added code to retrieve view offset for window.
Main.cxx
--------
Added code to load and move an aircraft carrier.
Patch to enable clouds from command line until Curtis fixes it. By default cloud
s are disabled.
2000-10-19 19:46:13 +00:00
|
|
|
}
|
|
|
|
}
|
2006-06-12 21:34:47 +00:00
|
|
|
|
2006-06-14 12:49:27 +00:00
|
|
|
} else { // if (scr_hole)
|
2006-06-12 21:34:47 +00:00
|
|
|
// Draw ladder with space in the middle of the lines
|
2006-06-14 12:49:27 +00:00
|
|
|
float hole = (float)((scr_hole) / 2.0f);
|
2006-06-12 21:34:47 +00:00
|
|
|
|
|
|
|
x_end = -half_span + hole;
|
2006-06-14 12:49:27 +00:00
|
|
|
x_ini2 = half_span - hole;
|
2006-06-12 21:34:47 +00:00
|
|
|
|
2006-06-14 12:49:27 +00:00
|
|
|
for (; i < last; i++) {
|
|
|
|
if (hudladder_type == "Pitch Ladder")
|
2006-06-12 21:34:47 +00:00
|
|
|
y = (((float)(i - pitch_value) * factor) + .5);
|
2006-06-14 12:49:27 +00:00
|
|
|
else if (hudladder_type == "Climb/Dive Ladder")
|
2006-06-12 21:34:47 +00:00
|
|
|
y = (((float)(i - actslope) * factor) + .5);
|
|
|
|
|
|
|
|
if (!(i % div_units)) { // At integral multiple of div
|
2006-06-14 12:49:27 +00:00
|
|
|
sprintf(TextLadder, "%d", i);
|
|
|
|
font->getBBox(TextLadder, pointsize, italic,
|
|
|
|
&left, &right, &bot, &top);
|
|
|
|
label_length = right - left;
|
2006-06-12 21:34:47 +00:00
|
|
|
label_length += text_offset;
|
2006-06-14 12:49:27 +00:00
|
|
|
label_height = (top - bot) / 2.0f;
|
|
|
|
// printf("l %f r %f b %f t %f\n",left, right, bot, top);
|
2006-06-12 21:34:47 +00:00
|
|
|
|
|
|
|
// Start by calculating the points and drawing the
|
|
|
|
// left side lines.
|
|
|
|
x_ini = -half_span;
|
2006-06-14 12:49:27 +00:00
|
|
|
x_end2 = half_span;
|
2006-06-12 21:34:47 +00:00
|
|
|
|
2006-06-14 12:49:27 +00:00
|
|
|
if (i >= 0) {
|
2006-06-12 21:34:47 +00:00
|
|
|
// Make zero point wider on left
|
2006-06-14 12:49:27 +00:00
|
|
|
if (i == 0) {
|
2006-06-12 21:34:47 +00:00
|
|
|
x_ini -= zero_offset;
|
2006-06-14 12:49:27 +00:00
|
|
|
x_end2 += zero_offset;
|
2006-06-12 21:34:47 +00:00
|
|
|
}
|
|
|
|
//draw climb bar vertical lines
|
|
|
|
if (climb_dive_ladder) {
|
|
|
|
// Zero or above draw solid lines
|
2006-06-14 12:49:27 +00:00
|
|
|
Line(x_end, y - 5.0, x_end, y);
|
|
|
|
Line(x_ini2, y - 5.0, x_ini2, y);
|
2006-06-12 21:34:47 +00:00
|
|
|
}
|
|
|
|
// draw pitch / climb bar
|
|
|
|
Line(x_ini, y, x_end, y);
|
|
|
|
Line(x_ini2, y, x_end2, y);
|
|
|
|
|
|
|
|
if (i == 90 && zenith == 1)
|
2006-06-14 12:49:27 +00:00
|
|
|
drawZenith(x_ini2, x_end, y);
|
2006-06-12 21:34:47 +00:00
|
|
|
|
|
|
|
} else { // i < 0
|
|
|
|
// draw dive bar vertical lines
|
|
|
|
if (climb_dive_ladder) {
|
2006-06-14 12:49:27 +00:00
|
|
|
Line(x_end, y + 5.0, x_end, y);
|
|
|
|
Line(x_ini2, y + 5.0, x_ini2, y);
|
2006-06-12 21:34:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// draw pitch / dive bars
|
|
|
|
StippleLine(x_ini, y, x_end, y);
|
|
|
|
StippleLine(x_ini2, y, x_end2, y);
|
|
|
|
|
|
|
|
if (i == -90 && nadir == 1)
|
2006-06-14 12:49:27 +00:00
|
|
|
drawNadir(x_ini2, x_end, y);
|
2006-06-12 21:34:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Now calculate the location of the left side label using
|
2006-06-14 12:49:27 +00:00
|
|
|
Text(x_ini-label_length, y - label_height, TextLadder);
|
|
|
|
Text(x_end2+text_offset, y - label_height, TextLadder);
|
2006-06-12 21:34:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// OBJECT LADDER MARK
|
|
|
|
// TYPE LINE
|
|
|
|
// ATTRIB - ON CONDITION
|
|
|
|
// draw appraoch glide slope marker
|
2004-10-20 08:15:55 +00:00
|
|
|
#ifdef ENABLE_SP_FMDS
|
2006-06-12 21:34:47 +00:00
|
|
|
if (glide_slope_marker && ihook) {
|
2006-06-14 12:49:27 +00:00
|
|
|
Line(-half_span + 15, (glide_slope-actslope) * factor,
|
|
|
|
-half_span + hole, (glide_slope - actslope) * factor);
|
|
|
|
Line(half_span - 15, (glide_slope-actslope) * factor,
|
|
|
|
half_span - hole, (glide_slope - actslope) * factor);
|
|
|
|
}
|
2004-10-20 08:15:55 +00:00
|
|
|
#endif
|
2006-06-12 21:34:47 +00:00
|
|
|
}
|
The following changes were made to flightgear-0.7.5 code to implement the follow
ing features:
a) ADA Flight model - ADA.cxx, ADA.hxx, flight.hxx
b) Fighter a/c HUD - flight.hxx, hud.hxx, hud.cxx, cockpit.cxx, hud_ladr.c
xx, hud_card.cxx
c) 3-window display - options.hxx, options.cxx, viewer.cxx
d) Moving objects (ship) - main.cxx
e) Patches - main.cxx
ADA.cxx, ADA.hxx
--------------------------
Interface to the external ADA flight dynamics package.
flight.hxx
----------
Included prototypes for accepting additional data fron the External flight
model for fighter aircraft HUD
Hud.hxx
-------
Included prototypes for accepting additional data for fighter HUD from Exernal F
light model.
Defined FIGHTER_HUD pre-processor directive to enable compilation of fighter hud
code.
hud.cxx, cockpit.cxx, hud_ladr.cxx, hud_card.cxx
---------------------------------------
Included code to initialise additional reticles/text for fighter HUD which is co
nditionally
compiled if FIGHTER_HUD is defined.
options.hxx
-----------
Added window_offset, and function to retrieve its value for 3 windows
options.cxx
-----------
Changed few options to suit ADA/CEF projection system/screens and checks for win
dow offset.
views.cxx
---------
Added code to retrieve view offset for window.
Main.cxx
--------
Added code to load and move an aircraft carrier.
Patch to enable clouds from command line until Curtis fixes it. By default cloud
s are disabled.
2000-10-19 19:46:13 +00:00
|
|
|
TextList.draw();
|
|
|
|
|
|
|
|
glLineWidth(0.2);
|
2006-06-12 21:34:47 +00:00
|
|
|
|
The following changes were made to flightgear-0.7.5 code to implement the follow
ing features:
a) ADA Flight model - ADA.cxx, ADA.hxx, flight.hxx
b) Fighter a/c HUD - flight.hxx, hud.hxx, hud.cxx, cockpit.cxx, hud_ladr.c
xx, hud_card.cxx
c) 3-window display - options.hxx, options.cxx, viewer.cxx
d) Moving objects (ship) - main.cxx
e) Patches - main.cxx
ADA.cxx, ADA.hxx
--------------------------
Interface to the external ADA flight dynamics package.
flight.hxx
----------
Included prototypes for accepting additional data fron the External flight
model for fighter aircraft HUD
Hud.hxx
-------
Included prototypes for accepting additional data for fighter HUD from Exernal F
light model.
Defined FIGHTER_HUD pre-processor directive to enable compilation of fighter hud
code.
hud.cxx, cockpit.cxx, hud_ladr.cxx, hud_card.cxx
---------------------------------------
Included code to initialise additional reticles/text for fighter HUD which is co
nditionally
compiled if FIGHTER_HUD is defined.
options.hxx
-----------
Added window_offset, and function to retrieve its value for 3 windows
options.cxx
-----------
Changed few options to suit ADA/CEF projection system/screens and checks for win
dow offset.
views.cxx
---------
Added code to retrieve view offset for window.
Main.cxx
--------
Added code to load and move an aircraft carrier.
Patch to enable clouds from command line until Curtis fixes it. By default cloud
s are disabled.
2000-10-19 19:46:13 +00:00
|
|
|
LineList.draw();
|
2006-06-12 21:34:47 +00:00
|
|
|
|
The following changes were made to flightgear-0.7.5 code to implement the follow
ing features:
a) ADA Flight model - ADA.cxx, ADA.hxx, flight.hxx
b) Fighter a/c HUD - flight.hxx, hud.hxx, hud.cxx, cockpit.cxx, hud_ladr.c
xx, hud_card.cxx
c) 3-window display - options.hxx, options.cxx, viewer.cxx
d) Moving objects (ship) - main.cxx
e) Patches - main.cxx
ADA.cxx, ADA.hxx
--------------------------
Interface to the external ADA flight dynamics package.
flight.hxx
----------
Included prototypes for accepting additional data fron the External flight
model for fighter aircraft HUD
Hud.hxx
-------
Included prototypes for accepting additional data for fighter HUD from Exernal F
light model.
Defined FIGHTER_HUD pre-processor directive to enable compilation of fighter hud
code.
hud.cxx, cockpit.cxx, hud_ladr.cxx, hud_card.cxx
---------------------------------------
Included code to initialise additional reticles/text for fighter HUD which is co
nditionally
compiled if FIGHTER_HUD is defined.
options.hxx
-----------
Added window_offset, and function to retrieve its value for 3 windows
options.cxx
-----------
Changed few options to suit ADA/CEF projection system/screens and checks for win
dow offset.
views.cxx
---------
Added code to retrieve view offset for window.
Main.cxx
--------
Added code to load and move an aircraft carrier.
Patch to enable clouds from command line until Curtis fixes it. By default cloud
s are disabled.
2000-10-19 19:46:13 +00:00
|
|
|
glEnable(GL_LINE_STIPPLE);
|
2006-06-14 12:49:27 +00:00
|
|
|
glLineStipple(1, 0x00FF);
|
|
|
|
StippleLineList.draw();
|
The following changes were made to flightgear-0.7.5 code to implement the follow
ing features:
a) ADA Flight model - ADA.cxx, ADA.hxx, flight.hxx
b) Fighter a/c HUD - flight.hxx, hud.hxx, hud.cxx, cockpit.cxx, hud_ladr.c
xx, hud_card.cxx
c) 3-window display - options.hxx, options.cxx, viewer.cxx
d) Moving objects (ship) - main.cxx
e) Patches - main.cxx
ADA.cxx, ADA.hxx
--------------------------
Interface to the external ADA flight dynamics package.
flight.hxx
----------
Included prototypes for accepting additional data fron the External flight
model for fighter aircraft HUD
Hud.hxx
-------
Included prototypes for accepting additional data for fighter HUD from Exernal F
light model.
Defined FIGHTER_HUD pre-processor directive to enable compilation of fighter hud
code.
hud.cxx, cockpit.cxx, hud_ladr.cxx, hud_card.cxx
---------------------------------------
Included code to initialise additional reticles/text for fighter HUD which is co
nditionally
compiled if FIGHTER_HUD is defined.
options.hxx
-----------
Added window_offset, and function to retrieve its value for 3 windows
options.cxx
-----------
Changed few options to suit ADA/CEF projection system/screens and checks for win
dow offset.
views.cxx
---------
Added code to retrieve view offset for window.
Main.cxx
--------
Added code to load and move an aircraft carrier.
Patch to enable clouds from command line until Curtis fixes it. By default cloud
s are disabled.
2000-10-19 19:46:13 +00:00
|
|
|
glDisable(GL_LINE_STIPPLE);
|
|
|
|
}
|
|
|
|
glDisable(GL_CLIP_PLANE0);
|
|
|
|
glDisable(GL_CLIP_PLANE1);
|
|
|
|
glDisable(GL_CLIP_PLANE2);
|
2006-06-12 21:34:47 +00:00
|
|
|
// glDisable(GL_SCISSOR_TEST);
|
The following changes were made to flightgear-0.7.5 code to implement the follow
ing features:
a) ADA Flight model - ADA.cxx, ADA.hxx, flight.hxx
b) Fighter a/c HUD - flight.hxx, hud.hxx, hud.cxx, cockpit.cxx, hud_ladr.c
xx, hud_card.cxx
c) 3-window display - options.hxx, options.cxx, viewer.cxx
d) Moving objects (ship) - main.cxx
e) Patches - main.cxx
ADA.cxx, ADA.hxx
--------------------------
Interface to the external ADA flight dynamics package.
flight.hxx
----------
Included prototypes for accepting additional data fron the External flight
model for fighter aircraft HUD
Hud.hxx
-------
Included prototypes for accepting additional data for fighter HUD from Exernal F
light model.
Defined FIGHTER_HUD pre-processor directive to enable compilation of fighter hud
code.
hud.cxx, cockpit.cxx, hud_ladr.cxx, hud_card.cxx
---------------------------------------
Included code to initialise additional reticles/text for fighter HUD which is co
nditionally
compiled if FIGHTER_HUD is defined.
options.hxx
-----------
Added window_offset, and function to retrieve its value for 3 windows
options.cxx
-----------
Changed few options to suit ADA/CEF projection system/screens and checks for win
dow offset.
views.cxx
---------
Added code to retrieve view offset for window.
Main.cxx
--------
Added code to load and move an aircraft carrier.
Patch to enable clouds from command line until Curtis fixes it. By default cloud
s are disabled.
2000-10-19 19:46:13 +00:00
|
|
|
glPopMatrix();
|
2001-01-05 16:44:48 +00:00
|
|
|
//*************************************************************
|
2006-06-12 21:34:47 +00:00
|
|
|
|
2001-01-05 16:44:48 +00:00
|
|
|
//*************************************************************
|
2004-10-20 08:15:55 +00:00
|
|
|
#ifdef ENABLE_SP_FMDS
|
2006-06-12 21:34:47 +00:00
|
|
|
if (waypoint_marker) {
|
|
|
|
//waypoint marker computation
|
2006-06-14 12:49:27 +00:00
|
|
|
float fromwp_lat, towp_lat, fromwp_lon, towp_lon, dist, delx, dely, hyp, theta, brg;
|
2006-06-12 21:34:47 +00:00
|
|
|
|
2006-06-14 12:49:27 +00:00
|
|
|
fromwp_lon = get_longitude() * SGD_DEGREES_TO_RADIANS;
|
|
|
|
fromwp_lat = get_latitude() * SGD_DEGREES_TO_RADIANS;
|
|
|
|
towp_lon = get_aux2() * SGD_DEGREES_TO_RADIANS;
|
|
|
|
towp_lat = get_aux1() * SGD_DEGREES_TO_RADIANS;
|
2006-06-12 21:34:47 +00:00
|
|
|
|
2006-06-14 12:49:27 +00:00
|
|
|
dist = acos(sin(fromwp_lat) * sin(towp_lat) + cos(fromwp_lat)
|
|
|
|
* cos(towp_lat) * cos(fabs(fromwp_lon - towp_lon)));
|
2006-06-12 21:34:47 +00:00
|
|
|
delx= towp_lat - fromwp_lat;
|
|
|
|
dely = towp_lon - fromwp_lon;
|
2006-06-14 12:49:27 +00:00
|
|
|
hyp = sqrt(pow(delx, 2) + pow(dely, 2));
|
2006-06-12 21:34:47 +00:00
|
|
|
|
|
|
|
if (hyp != 0)
|
2006-06-14 12:49:27 +00:00
|
|
|
theta = asin(dely / hyp);
|
2006-06-12 21:34:47 +00:00
|
|
|
else
|
|
|
|
theta = 0.0;
|
|
|
|
|
2006-06-14 12:49:27 +00:00
|
|
|
brg = theta * SGD_RADIANS_TO_DEGREES;
|
2006-06-12 21:34:47 +00:00
|
|
|
if (brg > 360.0)
|
|
|
|
brg = 0.0;
|
|
|
|
if (delx < 0)
|
|
|
|
brg = 180 - brg;
|
|
|
|
|
|
|
|
// {Brg = asin(cos(towp_lat)*sin(fabs(fromwp_lon-towp_lon))/ sin(dist));
|
|
|
|
// Brg = Brg * SGD_RADIANS_TO_DEGREES; }
|
|
|
|
|
2006-06-14 12:49:27 +00:00
|
|
|
dist *= SGD_RADIANS_TO_DEGREES * 60.0 * 1852.0; //rad->deg->nm->m
|
2006-06-12 21:34:47 +00:00
|
|
|
// end waypoint marker computation
|
|
|
|
|
|
|
|
//*********************************************************
|
|
|
|
// OBJECT MOVING RETICLE
|
|
|
|
// TYPE ARROW
|
|
|
|
// waypoint marker
|
|
|
|
if (fabs(brg-psi) > 10.0) {
|
|
|
|
glPushMatrix();
|
2006-06-14 12:49:27 +00:00
|
|
|
glTranslatef(centroid.x, centroid.y, 0);
|
|
|
|
glTranslatef(vel_x, vel_y, 0);
|
|
|
|
glRotatef(brg - psi, 0.0, 0.0, -1.0);
|
2006-06-12 21:34:47 +00:00
|
|
|
glBegin(GL_LINE_LOOP);
|
2006-06-14 12:49:27 +00:00
|
|
|
glVertex2f(-2.5, 20.0);
|
|
|
|
glVertex2f(-2.5, 30.0);
|
|
|
|
glVertex2f(-5.0, 30.0);
|
|
|
|
glVertex2f(0.0, 35.0);
|
|
|
|
glVertex2f(5.0, 30.0);
|
|
|
|
glVertex2f(2.5, 30.0);
|
|
|
|
glVertex2f(2.5, 20.0);
|
2006-06-12 21:34:47 +00:00
|
|
|
glEnd();
|
|
|
|
glPopMatrix();
|
|
|
|
}
|
2001-09-19 22:23:25 +00:00
|
|
|
|
2006-06-12 21:34:47 +00:00
|
|
|
// waypoint marker on heading scale
|
|
|
|
if (fabs(brg-psi) < 12.0) {
|
|
|
|
if (hat == 0) {
|
|
|
|
glBegin(GL_LINE_LOOP);
|
2006-06-14 12:49:27 +00:00
|
|
|
glVertex2f(((brg - psi) * 60 / 25) + 320, 240.0);
|
|
|
|
glVertex2f(((brg - psi) * 60 / 25) + 326, 240.0 - 4);
|
|
|
|
glVertex2f(((brg - psi) * 60 / 25) + 323, 240.0 - 4);
|
|
|
|
glVertex2f(((brg - psi) * 60 / 25) + 323, 240.0 - 8);
|
|
|
|
glVertex2f(((brg - psi) * 60 / 25) + 317, 240.0 - 8);
|
|
|
|
glVertex2f(((brg - psi) * 60 / 25) + 317, 240.0 - 4);
|
|
|
|
glVertex2f(((brg - psi) * 60 / 25) + 314, 240.0 - 4);
|
2006-06-12 21:34:47 +00:00
|
|
|
glEnd();
|
|
|
|
|
|
|
|
} else { //if hat=0
|
2006-06-14 12:49:27 +00:00
|
|
|
float x = (brg - psi) * 60 / 25 + 320, y = 240.0, r = 5.0;
|
|
|
|
float x1, y1;
|
2006-06-12 21:34:47 +00:00
|
|
|
|
|
|
|
glEnable(GL_POINT_SMOOTH);
|
|
|
|
glBegin(GL_POINTS);
|
|
|
|
|
|
|
|
for (int count = 0; count <= 200; count++) {
|
2006-06-14 12:49:27 +00:00
|
|
|
float temp = count * 3.142 * 3 / (200.0 * 2.0);
|
|
|
|
float temp1 = temp - (45.0 * SGD_DEGREES_TO_RADIANS);
|
2006-06-12 21:34:47 +00:00
|
|
|
x1 = x + r * cos(temp1);
|
|
|
|
y1 = y + r * sin(temp1);
|
|
|
|
glVertex2f(x1, y1);
|
|
|
|
}
|
2001-09-19 22:23:25 +00:00
|
|
|
|
2006-06-12 21:34:47 +00:00
|
|
|
glEnd();
|
|
|
|
glDisable(GL_POINT_SMOOTH);
|
|
|
|
} //hat=0
|
2001-09-19 22:23:25 +00:00
|
|
|
|
2006-06-12 21:34:47 +00:00
|
|
|
} //brg<12
|
|
|
|
} // if waypoint_marker
|
|
|
|
#endif
|
|
|
|
}//draw
|
2001-09-19 22:23:25 +00:00
|
|
|
|
|
|
|
|
2006-06-12 21:34:47 +00:00
|
|
|
/******************************************************************/
|
2006-06-14 12:49:27 +00:00
|
|
|
// draws the zenith symbol for highest possible climb angle (i.e. 90 degree climb angle)
|
2006-06-12 21:34:47 +00:00
|
|
|
//
|
2006-06-14 12:49:27 +00:00
|
|
|
void HudLadder::drawZenith(float xfirst, float xlast, float yvalue)
|
2001-09-19 22:23:25 +00:00
|
|
|
{
|
2006-06-14 12:49:27 +00:00
|
|
|
float xcentre = (xfirst + xlast) / 2.0;
|
2006-06-12 21:34:47 +00:00
|
|
|
float ycentre = yvalue;
|
2001-09-19 22:23:25 +00:00
|
|
|
|
2006-06-14 12:49:27 +00:00
|
|
|
Line(xcentre - 9.0, ycentre, xcentre - 3.0, ycentre + 1.3);
|
|
|
|
Line(xcentre - 9.0, ycentre, xcentre - 3.0, ycentre - 1.3);
|
2001-09-19 22:23:25 +00:00
|
|
|
|
2006-06-14 12:49:27 +00:00
|
|
|
Line(xcentre + 9.0, ycentre, xcentre + 3.0, ycentre + 1.3);
|
|
|
|
Line(xcentre + 9.0, ycentre, xcentre + 3.0, ycentre - 1.3);
|
2001-09-19 22:23:25 +00:00
|
|
|
|
2006-06-14 12:49:27 +00:00
|
|
|
Line(xcentre, ycentre + 9.0, xcentre - 1.3, ycentre + 3.0);
|
|
|
|
Line(xcentre, ycentre + 9.0, xcentre + 1.3, ycentre + 3.0);
|
2001-09-19 22:23:25 +00:00
|
|
|
|
2006-06-14 12:49:27 +00:00
|
|
|
Line(xcentre - 3.9, ycentre + 3.9, xcentre - 3.0, ycentre + 1.3);
|
|
|
|
Line(xcentre - 3.9, ycentre + 3.9, xcentre - 1.3, ycentre + 3.0);
|
2001-09-19 22:23:25 +00:00
|
|
|
|
2006-06-14 12:49:27 +00:00
|
|
|
Line(xcentre + 3.9, ycentre + 3.9, xcentre + 1.3, ycentre+3.0);
|
|
|
|
Line(xcentre + 3.9, ycentre + 3.9, xcentre + 3.0, ycentre+1.3);
|
2001-09-19 22:23:25 +00:00
|
|
|
|
2006-06-14 12:49:27 +00:00
|
|
|
Line(xcentre - 3.9, ycentre - 3.9, xcentre - 3.0, ycentre-1.3);
|
|
|
|
Line(xcentre - 3.9, ycentre - 3.9, xcentre - 1.3, ycentre-2.6);
|
2001-09-19 22:23:25 +00:00
|
|
|
|
2006-06-14 12:49:27 +00:00
|
|
|
Line(xcentre + 3.9, ycentre - 3.9, xcentre + 3.0, ycentre-1.3);
|
|
|
|
Line(xcentre + 3.9, ycentre - 3.9, xcentre + 1.3, ycentre-2.6);
|
2001-09-19 22:23:25 +00:00
|
|
|
|
2006-06-14 12:49:27 +00:00
|
|
|
Line(xcentre - 1.3, ycentre - 2.6, xcentre, ycentre - 27.0);
|
|
|
|
Line(xcentre + 1.3, ycentre - 2.6, xcentre, ycentre - 27.0);
|
2006-06-12 21:34:47 +00:00
|
|
|
}
|
2001-09-19 22:23:25 +00:00
|
|
|
|
|
|
|
|
2006-06-14 12:49:27 +00:00
|
|
|
// draws the nadir symbol for lowest possible dive angle (i.e. 90 degree dive angle)
|
2006-06-12 21:34:47 +00:00
|
|
|
//
|
|
|
|
void HudLadder::drawNadir(float xfirst, float xlast, float yvalue)
|
|
|
|
{
|
2006-06-14 12:49:27 +00:00
|
|
|
float xcentre = (xfirst + xlast) / 2.0;
|
2006-06-12 21:34:47 +00:00
|
|
|
float ycentre = yvalue;
|
2001-09-19 22:23:25 +00:00
|
|
|
|
2006-06-12 21:34:47 +00:00
|
|
|
float r = 7.5;
|
2006-06-14 12:49:27 +00:00
|
|
|
float x1, y1, x2, y2;
|
2001-09-19 22:23:25 +00:00
|
|
|
|
2006-06-12 21:34:47 +00:00
|
|
|
// to draw a circle
|
|
|
|
float xcent1, xcent2, ycent1, ycent2;
|
2006-06-14 12:49:27 +00:00
|
|
|
xcent1 = xcentre + r;
|
|
|
|
ycent1 = ycentre;
|
2001-09-19 22:23:25 +00:00
|
|
|
|
2006-06-14 12:49:27 +00:00
|
|
|
for (int count = 1; count <= 400; count++) {
|
2006-06-12 21:34:47 +00:00
|
|
|
float temp = count * 2 * 3.142 / 400.0;
|
|
|
|
xcent2 = xcentre + r * cos(temp);
|
|
|
|
ycent2 = ycentre + r * sin(temp);
|
2001-09-19 22:23:25 +00:00
|
|
|
|
2006-06-12 21:34:47 +00:00
|
|
|
Line(xcent1, ycent1, xcent2, ycent2);
|
2001-09-19 22:23:25 +00:00
|
|
|
|
2006-06-12 21:34:47 +00:00
|
|
|
xcent1 = xcent2;
|
|
|
|
ycent1 = ycent2;
|
|
|
|
}
|
2001-09-19 22:23:25 +00:00
|
|
|
|
2006-06-14 12:49:27 +00:00
|
|
|
xcent2 = xcentre + r;
|
|
|
|
ycent2 = ycentre;
|
2001-09-19 22:23:25 +00:00
|
|
|
|
2006-06-12 21:34:47 +00:00
|
|
|
drawOneLine(xcent1, ycent1, xcent2, ycent2); //to connect last point to first point
|
|
|
|
//end circle
|
2001-09-19 22:23:25 +00:00
|
|
|
|
2006-06-14 12:49:27 +00:00
|
|
|
//to draw a line above the circle
|
|
|
|
Line(xcentre, ycentre + 7.5, xcentre, ycentre + 22.5);
|
2001-09-19 22:23:25 +00:00
|
|
|
|
2006-06-14 12:49:27 +00:00
|
|
|
//line in the middle of circle
|
|
|
|
Line(xcentre - 7.5, ycentre, xcentre + 7.5, ycentre);
|
2001-09-19 22:23:25 +00:00
|
|
|
|
2006-06-14 12:49:27 +00:00
|
|
|
float theta = asin (2.5 / 7.5);
|
|
|
|
float theta1 = asin(5.0 / 7.5);
|
2001-09-19 22:23:25 +00:00
|
|
|
|
2006-06-12 21:34:47 +00:00
|
|
|
x1 = xcentre + r * cos(theta);
|
|
|
|
y1 = ycentre + 2.5;
|
|
|
|
x2 = xcentre + r * cos((180.0 * SGD_DEGREES_TO_RADIANS) - theta);
|
|
|
|
y2 = ycentre + 2.5;
|
2006-06-14 12:49:27 +00:00
|
|
|
Line(x1, y1, x2, y2);
|
2001-09-19 22:23:25 +00:00
|
|
|
|
2006-06-12 21:34:47 +00:00
|
|
|
x1 = xcentre + r * cos(theta1);
|
|
|
|
y1 = ycentre + 5.0;
|
2006-06-14 12:49:27 +00:00
|
|
|
x2 = xcentre + r * cos((180.0 * SGD_DEGREES_TO_RADIANS) - theta1);
|
2006-06-12 21:34:47 +00:00
|
|
|
y2 = ycentre + 5.0;
|
2006-06-14 12:49:27 +00:00
|
|
|
Line(x1, y1, x2, y2);
|
2001-09-19 22:23:25 +00:00
|
|
|
|
2006-06-14 12:49:27 +00:00
|
|
|
x1 = xcentre + r * cos((180.0 * SGD_DEGREES_TO_RADIANS) + theta);
|
2006-06-12 21:34:47 +00:00
|
|
|
y1 = ycentre - 2.5;
|
2006-06-14 12:49:27 +00:00
|
|
|
x2 = xcentre + r * cos((360.0 * SGD_DEGREES_TO_RADIANS) - theta);
|
2006-06-12 21:34:47 +00:00
|
|
|
y2 = ycentre - 2.5;
|
2006-06-14 12:49:27 +00:00
|
|
|
Line(x1, y1, x2, y2);
|
2001-09-19 22:23:25 +00:00
|
|
|
|
2006-06-14 12:49:27 +00:00
|
|
|
x1 = xcentre + r * cos((180.0 * SGD_DEGREES_TO_RADIANS) + theta1);
|
2006-06-12 21:34:47 +00:00
|
|
|
y1 = ycentre - 5.0;
|
2006-06-14 12:49:27 +00:00
|
|
|
x2 = xcentre + r * cos((360.0 * SGD_DEGREES_TO_RADIANS) - theta1);
|
2006-06-12 21:34:47 +00:00
|
|
|
y2 = ycentre - 5.0;
|
2006-06-14 12:49:27 +00:00
|
|
|
Line(x1, y1, x2, y2);
|
2006-06-12 21:34:47 +00:00
|
|
|
}
|
2001-09-19 22:23:25 +00:00
|
|
|
|
|
|
|
|