+ if (target_spot) {
+#define CENTER_DIAMOND_SIZE 6.0
+ glBegin(GL_LINE_LOOP);
+ glVertex2f(-CENTER_DIAMOND_SIZE, 0.0);
+ glVertex2f(0.0, CENTER_DIAMOND_SIZE);
+ glVertex2f(CENTER_DIAMOND_SIZE, 0.0);
+ glVertex2f(0.0, -CENTER_DIAMOND_SIZE);
+ glEnd();
+#undef CENTER_DIAMOND_SIZE
+ }
+
+ //****************************************************************
+ //velocity vector reticle - computations
+ 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;
+
+ total_vel = sqrt(Vxx * Vxx + Vyy * Vyy + Vzz * Vzz);
+ ground_vel = sqrt(Vxx * Vxx + Vyy * Vyy);
+ up_vel = Vzz;
+
+ if (ground_vel < 2.0) {
+ if (fabs(up_vel) < 2.0)
+ actslope = 0.0;
+ else
+ actslope = (up_vel / fabs(up_vel)) * 90.0;
+
+ } else {
+ actslope = atan(up_vel / ground_vel) * SGD_RADIANS_TO_DEGREES;
+ }
+
+ 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))
+ * (factor/globals->get_current_view()->get_aspect_ratio());
+ // printf("%f %f %f %f\n",vel_x, vel_y, drift, psi);
+
+ //****************************************************************
+ // OBJECT MOVING RETICLE
+ // TYPE - DRIFT MARKER
+ // ATTRIB - ALWAYS
+ // drift marker
+ if (drift_marker) {
+ glBegin(GL_LINE_STRIP);
+ glVertex2f((xvvr * 25 / 120) - 6, -4);
+ glVertex2f(xvvr * 25 / 120, 8);
+ glVertex2f((xvvr * 25 / 120) + 6, -4);
+ glEnd();
+ }
+
+ //****************************************************************
+ // Clipping coordinates for ladder to be input from xml file
+ // Clip hud ladder
+ if (clip_plane) {
+ glClipPlane(GL_CLIP_PLANE0, eqn_top);
+ glEnable(GL_CLIP_PLANE0);
+ glClipPlane(GL_CLIP_PLANE1, eqn_left);
+ glEnable(GL_CLIP_PLANE1);
+ glClipPlane(GL_CLIP_PLANE2, eqn_right);
+ glEnable(GL_CLIP_PLANE2);
+ // glScissor(-100,-240, 200, 240);
+ // glEnable(GL_SCISSOR_TEST);
+ }
+
+ //****************************************************************
+ // OBJECT MOVING RETICLE
+ // TYPE VELOCITY VECTOR
+ // ATTRIB - ALWAYS
+ // velocity vector
+ glBegin(GL_LINE_LOOP); // Use polygon to approximate a circle
+ 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);
+ }
+ glEnd();
+
+ //velocity vector reticle orientation lines
+ glBegin(GL_LINE_STRIP);
+ glVertex2f(vel_x - 12, vel_y);
+ glVertex2f(vel_x - 6, vel_y);
+ glEnd();
+ glBegin(GL_LINE_STRIP);
+ glVertex2f(vel_x + 12, vel_y);
+ glVertex2f(vel_x + 6, vel_y);
+ glEnd();
+ glBegin(GL_LINE_STRIP);
+ glVertex2f(vel_x, vel_y + 12);
+ glVertex2f(vel_x, vel_y + 6);
+ glEnd();
+
+#ifdef ENABLE_SP_FDM
+ // OBJECT MOVING RETICLE
+ // TYPE LINE
+ // ATTRIB - ON CONDITION
+ if (lgear == 1) {
+ // undercarriage status
+ glBegin(GL_LINE_STRIP);
+ glVertex2f(vel_x + 8, vel_y);
+ glVertex2f(vel_x + 8, vel_y - 4);
+ glEnd();
+
+ // OBJECT MOVING RETICLE
+ // TYPE LINE
+ // ATTRIB - ON CONDITION
+ glBegin(GL_LINE_STRIP);
+ glVertex2f(vel_x - 8, vel_y);
+ glVertex2f(vel_x - 8, vel_y - 4);
+ glEnd();
+
+ // OBJECT MOVING RETICLE
+ // TYPE LINE
+ // ATTRIB - ON CONDITION
+ glBegin(GL_LINE_STRIP);
+ glVertex2f(vel_x, vel_y - 6);
+ glVertex2f(vel_x, vel_y - 10);
+ glEnd();
+ }
+
+ // OBJECT MOVING RETICLE
+ // TYPE V
+ // ATTRIB - ON CONDITION
+ if (ihook == 1) {
+ // arrestor hook status
+ glBegin(GL_LINE_STRIP);
+ glVertex2f(vel_x - 4, vel_y - 8);
+ glVertex2f(vel_x, vel_y - 10);
+ glVertex2f(vel_x + 4, vel_y - 8);
+ glEnd();
+ }
+#endif
+ } // if velocity_vector
+
+
+ //***************************************************************
+ // OBJECT MOVING RETICLE
+ // TYPE - SQUARE_BRACKET
+ // ATTRIB - ON CONDITION
+ // alpha bracket
+#ifdef ENABLE_SP_FDM
+ if (alpha_bracket && ihook == 1) {
+ glBegin(GL_LINE_STRIP);
+ 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);
+ glEnd();
+
+ glBegin(GL_LINE_STRIP);
+ 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);
+ glEnd();
+ }
+#endif
+ //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);
+
+ //****************************************************************
+ // OBJECT MOVING RETICLE
+ // TYPE ENERGY_MARKERS
+ // ATTRIB - ALWAYS
+ //energy markers - compute potential slope
+ if (energy_marker) {
+ if (total_vel < 5.0) {
+ t1 = 0;
+ t2 = 0;
+ } else {
+ t1 = up_vel / total_vel;
+ t2 = asin((Vxx * Axx + Vyy * Ayy + Vzz * Azz) / (9.81 * total_vel));
+ }
+ 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;
+
+ //energy markers
+ glBegin(GL_LINE_STRIP);
+ glVertex2f(vel_x - 20, pot_slope - 5);
+ glVertex2f(vel_x - 15, pot_slope);
+ glVertex2f(vel_x - 20, pot_slope + 5);
+ glEnd();
+
+ glBegin(GL_LINE_STRIP);
+ glVertex2f(vel_x + 20, pot_slope - 5);
+ glVertex2f(vel_x + 15, pot_slope);
+ glVertex2f(vel_x + 20, pot_slope + 5);
+ glEnd();
+
+ if (pla > (105.0 / 131.0)) {
+ glBegin(GL_LINE_STRIP);
+ glVertex2f(vel_x - 24, pot_slope - 5);
+ glVertex2f(vel_x - 19, pot_slope);
+ glVertex2f(vel_x - 24, pot_slope + 5);
+ glEnd();
+
+ glBegin(GL_LINE_STRIP);
+ glVertex2f(vel_x + 24, pot_slope - 5);
+ glVertex2f(vel_x + 19, pot_slope);
+ glVertex2f(vel_x + 24, pot_slope + 5);
+ glEnd();
+ }