#include "hud.hxx"
#include <math.h>
-#include <Main/fg_props.hxx>
#include <Main/globals.hxx>
#include <Scenery/scenery.hxx>
#include <Aircraft/aircraft.hxx>
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;
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
}
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;
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;
}