+ //*************************************************************
+
+ //*************************************************************
+#ifdef ENABLE_SP_FDM
+ if (waypoint_marker) {
+ //waypoint marker computation
+ float fromwp_lat, towp_lat, fromwp_lon, towp_lon, dist, delx, dely, hyp, theta, brg;
+
+ 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;
+
+ dist = acos(sin(fromwp_lat) * sin(towp_lat) + cos(fromwp_lat)
+ * cos(towp_lat) * cos(fabs(fromwp_lon - towp_lon)));
+ delx= towp_lat - fromwp_lat;
+ dely = towp_lon - fromwp_lon;
+ hyp = sqrt(pow(delx, 2) + pow(dely, 2));
+
+ if (hyp != 0)
+ theta = asin(dely / hyp);
+ else
+ theta = 0.0;
+
+ brg = theta * SGD_RADIANS_TO_DEGREES;
+ 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; }
+
+ dist *= SGD_RADIANS_TO_DEGREES * 60.0 * 1852.0; //rad->deg->nm->m
+ // end waypoint marker computation
+
+ //*********************************************************
+ // OBJECT MOVING RETICLE
+ // TYPE ARROW
+ // waypoint marker
+ if (fabs(brg-psi) > 10.0) {
+ glPushMatrix();
+ glTranslatef(centroid.x, centroid.y, 0);
+ glTranslatef(vel_x, vel_y, 0);
+ glRotatef(brg - psi, 0.0, 0.0, -1.0);
+ glBegin(GL_LINE_LOOP);
+ 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);
+ glEnd();
+ glPopMatrix();
+ }
+
+ // waypoint marker on heading scale
+ if (fabs(brg-psi) < 12.0) {
+ if (hat == 0) {
+ glBegin(GL_LINE_LOOP);
+ 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);
+ glEnd();
+
+ } else { //if hat=0
+ float x = (brg - psi) * 60 / 25 + 320, y = 240.0, r = 5.0;
+ float x1, y1;
+
+ glEnable(GL_POINT_SMOOTH);
+ glBegin(GL_POINTS);
+
+ for (int count = 0; count <= 200; count++) {
+ float temp = count * 3.142 * 3 / (200.0 * 2.0);
+ float temp1 = temp - (45.0 * SGD_DEGREES_TO_RADIANS);
+ x1 = x + r * cos(temp1);
+ y1 = y + r * sin(temp1);
+ glVertex2f(x1, y1);
+ }
+
+ glEnd();
+ glDisable(GL_POINT_SMOOTH);
+ } //hat=0
+
+ } //brg<12
+ } // if waypoint_marker
+#endif
+}//draw
+
+
+/******************************************************************/
+// draws the zenith symbol for highest possible climb angle (i.e. 90 degree climb angle)
+//
+void HudLadder::drawZenith(float xfirst, float xlast, float yvalue)
+{
+ float xcentre = (xfirst + xlast) / 2.0;
+ float ycentre = yvalue;
+
+ Line(xcentre - 9.0, ycentre, xcentre - 3.0, ycentre + 1.3);
+ Line(xcentre - 9.0, ycentre, xcentre - 3.0, ycentre - 1.3);
+
+ Line(xcentre + 9.0, ycentre, xcentre + 3.0, ycentre + 1.3);
+ Line(xcentre + 9.0, ycentre, xcentre + 3.0, ycentre - 1.3);
+
+ Line(xcentre, ycentre + 9.0, xcentre - 1.3, ycentre + 3.0);
+ Line(xcentre, ycentre + 9.0, xcentre + 1.3, ycentre + 3.0);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ 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);
+
+ Line(xcentre - 1.3, ycentre - 2.6, xcentre, ycentre - 27.0);
+ Line(xcentre + 1.3, ycentre - 2.6, xcentre, ycentre - 27.0);