9 #include GLUT_H // needed before pu.h
10 #include <plib/pu.h> // plib include
12 #include <FDM/flight.hxx>
14 #include <Main/globals.hxx>
15 #include <Main/fg_init.hxx>
16 #include <Main/fg_props.hxx>
17 #include <Scenery/tilemgr.hxx>
18 #include <Time/light.hxx>
21 #include "trackball.h"
23 // FOR MOUSE VIEW MODE
24 // stashed trackball(_quat0, 0.0, 0.0, 0.0, 0.0);
25 static float _quat0[4];
30 // To apply our mouse rotation quat to VIEW
31 // sgPreMultMat4( VIEW, GuiQuat_mat);
32 // This is here temporarily should be in views.hxx
33 float GuiQuat_mat[4][4];
36 curGuiQuat[0] = _quat0[0];
37 curGuiQuat[1] = _quat0[1];
38 curGuiQuat[2] = _quat0[2];
39 curGuiQuat[3] = _quat0[3];
42 void initMouseQuat(void) {
43 trackball(_quat0, 0.0, 0.0, 0.0, 0.0);
45 build_rotmatrix(GuiQuat_mat, curGuiQuat);
49 void reInit(puObject *cb)
54 static const SGPropertyNode *master_freeze
55 = fgGetNode("/sim/freeze/master");
57 bool freeze = master_freeze->getBoolValue();
59 fgSetBool("/sim/freeze/master", true);
62 cur_fdm_state->unbind();
64 // in case user has changed window size as
65 // restoreInitialState() overwrites these
66 int xsize = fgGetInt("/sim/startup/xsize");
67 int ysize = fgGetInt("/sim/startup/ysize");
69 build_rotmatrix(GuiQuat_mat, curGuiQuat);
71 globals->restoreInitialState();
73 // update our position based on current presets
76 SGTime *t = globals->get_time_params();
79 globals->set_time_params( t );
83 globals->get_tile_mgr()->update( fgGetDouble("/environment/visibility-m") );
85 cur_light_params.Update();
87 fgReshape( xsize, ysize );
92 fgSetBool("/sim/freeze/master", false);