]> git.mxchange.org Git - flightgear.git/blobdiff - src/Cockpit/hud_rwy.cxx
make --enable-osgviewer the default
[flightgear.git] / src / Cockpit / hud_rwy.cxx
index 64d01a5b0f6411503615610498833d900790dc95..6b40e178fa419d2a556596fe6f2b01701eff7d59 100644 (file)
@@ -25,7 +25,6 @@
 #include "hud.hxx"
 
 #include <math.h>
-#include <Main/fg_props.hxx>
 #include <Main/globals.hxx>
 #include <Scenery/scenery.hxx>
 #include <Aircraft/aircraft.hxx>
@@ -106,13 +105,16 @@ void runway_instr::draw()
             globals->get_viewmgr()->copyToCurrent();
         }
         //Set the camera to the cockpit view to get the view of the runway from the cockpit
-        ssgSetCamera((sgVec4 *)cockpit_view->get_VIEW());
+        // OSGFIXME
+//         ssgSetCamera((sgVec4 *)cockpit_view->get_VIEW());
         get_rwy_points(points3d);
         //Get the current project matrix
-        ssgGetProjectionMatrix(projMat);
+        // OSGFIXME
+//         ssgGetProjectionMatrix(projMat);
 //        const sgVec4 *viewMat = globals->get_current_view()->get_VIEW();
         //Get the current model view matrix (cockpit view)
-        ssgGetModelviewMatrix(modelView);
+        // OSGFIXME
+//         ssgGetModelviewMatrix(modelView);
         //Create a rotation matrix to correct for any offsets (other than default offsets) to the model view matrix
         sgMat4 xy; //rotation about the Rxy, negate the sin's on Ry
         xy[0][0] = cYaw;         xy[1][0] = 0.0f;   xy[2][0] = -sYaw;        xy[3][0] = 0.0f;
@@ -165,7 +167,8 @@ void runway_instr::draw()
             curr_view->setGoalPitchOffset_deg(gpo);
         }
         //Set the camera back to the current view
-        ssgSetCamera((sgVec4 *)curr_view);
+        // OSGFIXME
+//         ssgSetCamera((sgVec4 *)curr_view);
         glPopAttrib();
     }//if not broken
 }
@@ -182,13 +185,6 @@ bool runway_instr::get_active_runway(FGRunway& runway)
 
 void runway_instr::get_rwy_points(sgdVec3 *points3d)
 {
-    static Point3D center = globals->get_scenery()->get_center();
-
-    //Get the current tile center
-    Point3D currentCenter = globals->get_scenery()->get_center();
-    Point3D tileCenter = currentCenter;
-    if (center != currentCenter) //if changing tiles
-        tileCenter = center; //use last center
     double alt = current_aircraft.fdm_state->get_Runway_altitude() * SG_FEET_TO_METER;
     double length = (runway._length / 2.0) * SG_FEET_TO_METER;
     double width = (runway._width / 2.0) * SG_FEET_TO_METER;
@@ -211,13 +207,6 @@ void runway_instr::get_rwy_points(sgdVec3 *points3d)
 
     geo_direct_wgs_84(alt, frontLat, frontLon, runway._heading + 90, width, &tempLat, &tempLon, &az);
     sgGeodToCart(tempLat * SG_DEGREES_TO_RADIANS, tempLon * SG_DEGREES_TO_RADIANS, alt, points3d[3]);
-
-    for (int i = 0; i < 6; i++) {
-        points3d[i][0] -= tileCenter.x();
-        points3d[i][1] -= tileCenter.y();
-        points3d[i][2] -= tileCenter.z();
-    }
-    center = currentCenter;
 }