# include <windows.h>
#endif
-#include <GL/glut.h>
-#include <GL/gl.h>
+#include GLUT_H
#if defined(FX) && defined(XMESA)
# include <GL/xmesa.h>
#include "gui_local.hxx"
SG_USING_STD(string);
-
-#ifndef SG_HAVE_NATIVE_SGI_COMPILERS
SG_USING_STD(cout);
-#endif
/* --------------------------------------------------------------------
Mouse stuff
static inline void set_goal_view_offset( float offset )
{
- globals->get_current_view()->set_goal_view_offset(offset);
+ globals->get_current_view()->setGoalHeadingOffset_deg(offset * SGD_RADIANS_TO_DEGREES);
}
static inline void set_view_offset( float offset )
{
- globals->get_current_view()->set_view_offset(offset);
+ globals->get_current_view()->setHeadingOffset_deg(offset * SGD_RADIANS_TO_DEGREES);
+}
+
+static inline void set_goal_view_tilt( float tilt )
+{
+ globals->get_current_view()->setGoalPitchOffset_deg(tilt);
+}
+
+static inline void set_view_tilt( float tilt )
+{
+ globals->get_current_view()->setPitchOffset_deg(tilt);
}
static inline float get_view_offset() {
- return globals->get_current_view()->get_view_offset();
+ return globals->get_current_view()->getHeadingOffset_deg() * SGD_DEGREES_TO_RADIANS;
}
static inline float get_goal_view_offset() {
- return globals->get_current_view()->get_goal_view_offset();
+ return globals->get_current_view()->getGoalHeadingOffset_deg() * SGD_DEGREES_TO_RADIANS;
}
static inline void move_brake(float offset) {
}
static inline bool AP_HeadingEnabled() {
- return current_autopilot->get_HeadingEnabled();
+ return globals->get_autopilot()->get_HeadingEnabled();
}
static inline bool AP_AltitudeEnabled() {
- return current_autopilot->get_AltitudeEnabled();
+ return globals->get_autopilot()->get_AltitudeEnabled();
}
void TurnCursorOn( void )
glutSetCursor(GLUT_CURSOR_INHERIT);
// Is this necessary ??
+#if defined(FG_OLD_MENU)
if( !gui_menu_on ) TurnCursorOff();
+#endif
glutWarpPointer( _savedX, _savedY );
}
wh = MOUSE_YSIZE;
if (mouse_mode == MOUSE_POINTER) {
+#if defined(FG_OLD_MENU)
// TURN MENU ON IF MOUSE AT TOP
if( y < 1 ) {
if( !gui_menu_on )
if( gui_menu_on )
guiToggleMenu();
}
- // puMouse ( x, y ) ;
+#endif
+ puMouse ( x, y ) ;
glutPostRedisplay () ;
} else {
if( x == _mX && y == _mY)
offset -= SGD_2PI;
}
set_goal_view_offset(offset);
+ set_goal_view_tilt(asin( GuiQuat_mat[1][2]) * SGD_RADIANS_TO_DEGREES );
#ifdef NO_SMOOTH_MOUSE_VIEW
set_view_offset(offset);
+ set_view_tilt(asin( GuiQuat_mat[1][2]) * SGD_RADIANS_TO_DEGREES );
#endif
break;
static float _quat[4];
static double _view_offset;
- // general purpose variables
- double offset;
-
glutModifiers = glutGetModifiers();
glut_active_shift = glutModifiers & GLUT_ACTIVE_SHIFT;
glut_active_ctrl = glutModifiers & GLUT_ACTIVE_CTRL;
y = _Vy;
sgCopyVec4(curGuiQuat, _quat);
set_goal_view_offset(_view_offset);
+ set_goal_view_tilt(0.0);
#ifdef NO_SMOOTH_MOUSE_VIEW
set_view_offset(_view_offset);
#endif
Quat0();
_view_offset = get_goal_view_offset();
set_goal_view_offset(0.0);
+ set_goal_view_tilt(0.0);
#ifdef NO_SMOOTH_MOUSE_VIEW
set_view_offset(0.0);
+ set_view_tilt(0.0);
#endif
}
glutWarpPointer( x , y);
Quat0();
build_rotmatrix(GuiQuat_mat, curGuiQuat);
set_goal_view_offset(0.0);
+ set_goal_view_tilt(0.0);
#ifdef NO_SMOOTH_MOUSE_VIEW
set_view_offset(0.0);
+ set_view_tilt(0.0);
#endif // NO_SMOOTH_MOUSE_VIEW
#endif // RESET_VIEW_ON_LEAVING_MOUSE_VIEW
glutSetCursor(GLUT_CURSOR_INHERIT);
-
+
+#if defined(FG_OLD_MENU)
#if defined(WIN32_CURSOR_TWEAKS_OFF)
if(!gui_menu_on)
TurnCursorOff();
#endif // WIN32_CURSOR_TWEAKS_OFF
+#endif // FG_OLD_MENU
break;
} // end switch (mouse_mode)
glutWarpPointer( x, y );
// know what's going on.
if (mouse_mode == MOUSE_POINTER) {
if (!puMouse (button, updown, x,y)) {
- if ( current_panel != NULL ) {
- current_panel->doMouseAction(button, updown, x, y);
+ if ( globals->get_current_panel() != NULL ) {
+ globals->get_current_panel()->doMouseAction(button, updown, x, y);
}
}
}
glutPostRedisplay ();
}
+
+
+