#include <simgear/compiler.h>
#include <simgear/math/sg_geodesy.hxx>
-#include <simgear/math/project.hxx>
+#include <simgear/scene/util/project.hxx>
#include <Main/globals.hxx>
#include <Scenery/scenery.hxx>
_scale_dist(node->getDoubleValue("scale-dist-nm")),
_default_pitch(fgGetDouble("/sim/view[0]/config/pitch-pitch-deg", 0.0)),
_default_heading(fgGetDouble("/sim/view[0]/config/pitch-heading-deg", 0.0)),
- _cockpit_view(globals->get_viewmgr()->get_view(0)),
_stipple_out(node->getIntValue("outer_stipple", 0xFFFF)),
_stipple_center(node->getIntValue("center-stipple", 0xFFFF)),
_draw_arrow(_arrow_scale > 0 ? true : false),
_top = _center_y + (_h / 2) + _y;
}
-
void HUD::Runway::draw()
{
_runway = get_active_runway();
float modelView[4][4], projMat[4][4];
bool anyLines;
//Get the current view
- FGViewer* curr_view = globals->get_viewmgr()->get_current_view();
- int curr_view_id = globals->get_viewmgr()->get_current();
- double gpo = curr_view->getGoalPitchOffset_deg();
- double gho = curr_view->getGoalHeadingOffset_deg();
- double po = curr_view->getPitchOffset_deg();
- double ho = curr_view->getHeadingOffset_deg();
-
- double yaw = -(_cockpit_view->getHeadingOffset_deg() - _default_heading) * SG_DEGREES_TO_RADIANS;
- double pitch = (_cockpit_view->getPitchOffset_deg() - _default_pitch) * SG_DEGREES_TO_RADIANS;
+// FGViewer* curr_view = globals->get_viewmgr()->get_current_view();
+// int curr_view_id = globals->get_viewmgr()->get_current();
+// double gpo = curr_view->getGoalPitchOffset_deg();
+// double gho = curr_view->getGoalHeadingOffset_deg();
+// double po = curr_view->getPitchOffset_deg();
+// double ho = curr_view->getHeadingOffset_deg();
+
+ FGViewer* cockpitView = globals->get_viewmgr()->get_view(0);
+
+ double yaw = -(cockpitView->getHeadingOffset_deg() - _default_heading) * SG_DEGREES_TO_RADIANS;
+ double pitch = (cockpitView->getPitchOffset_deg() - _default_pitch) * SG_DEGREES_TO_RADIANS;
//double roll = fgGetDouble("/sim/view[0]/config/roll-offset-deg",0.0) //TODO: adjust for default roll offset
double sPitch = sin(pitch), cPitch = cos(pitch),
sYaw = sin(yaw), cYaw = cos(yaw);
- //Assuming that the "Cockpit View" is always at position zero!!!
- if (curr_view_id != 0) {
- globals->get_viewmgr()->set_view(0);
- globals->get_viewmgr()->copyToCurrent();
- }
//Set the camera to the cockpit view to get the view of the runway from the cockpit
// OSGFIXME
// ssgSetCamera((sgVec4 *)_cockpit_view->get_VIEW());
drawArrow(); //draw indication arrow
}
- //Restore the current view and any offsets
- if (curr_view_id != 0) {
- globals->get_viewmgr()->set_view(curr_view_id);
- globals->get_viewmgr()->copyToCurrent();
- curr_view->setHeadingOffset_deg(ho);
- curr_view->setPitchOffset_deg(po);
- curr_view->setGoalHeadingOffset_deg(gho);
- curr_view->setGoalPitchOffset_deg(gpo);
- }
//Set the camera back to the current view
// OSGFIXME
// ssgSetCamera((sgVec4 *)curr_view);