9 #include <plib/pu.h> // plib include
11 #include <FDM/flight.hxx>
13 #include <Main/globals.hxx>
14 #include <Main/fg_init.hxx>
15 #include <Main/fg_props.hxx>
16 #include <Scenery/tilemgr.hxx>
17 #include <Time/light.hxx>
20 #include "trackball.h"
22 // FOR MOUSE VIEW MODE
23 // stashed trackball(_quat0, 0.0, 0.0, 0.0, 0.0);
24 static float _quat0[4];
29 // To apply our mouse rotation quat to VIEW
30 // sgPreMultMat4( VIEW, GuiQuat_mat);
31 // This is here temporarily should be in views.hxx
32 float GuiQuat_mat[4][4];
35 curGuiQuat[0] = _quat0[0];
36 curGuiQuat[1] = _quat0[1];
37 curGuiQuat[2] = _quat0[2];
38 curGuiQuat[3] = _quat0[3];
41 void initMouseQuat(void) {
42 trackball(_quat0, 0.0, 0.0, 0.0, 0.0);
44 build_rotmatrix(GuiQuat_mat, curGuiQuat);
48 void reInit(puObject *cb)
53 static const SGPropertyNode *master_freeze
54 = fgGetNode("/sim/freeze/master");
56 bool freeze = master_freeze->getBoolValue();
58 fgSetBool("/sim/freeze/master", true);
61 cur_fdm_state->unbind();
63 // in case user has changed window size as
64 // restoreInitialState() overwrites these
65 int xsize = fgGetInt("/sim/startup/xsize");
66 int ysize = fgGetInt("/sim/startup/ysize");
68 build_rotmatrix(GuiQuat_mat, curGuiQuat);
70 globals->restoreInitialState();
72 // update our position based on current presets
75 SGTime *t = globals->get_time_params();
78 globals->set_time_params( t );
82 globals->get_tile_mgr()->update( fgGetDouble("/environment/visibility-m") );
84 globals->get_renderer()->resize( xsize, ysize );
89 fgSetBool("/sim/freeze/master", false);