+ }
+ // TYPE WATERLINE_MARK (W shaped _ _ )
+ // \/\/
+
+ //****************************************************************
+ // TYPE TARGET_SPOT
+ // Draw the target spot.
+ 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();
+ }