9 #include <GL/glut.h> // needed before pu.h
10 #include <plib/pu.h> // plib include
12 #include <Main/globals.hxx>
13 #include <Main/fg_init.hxx>
14 #include <Main/fg_props.hxx>
17 #include "trackball.h"
20 extern void fgReshape(int, int);
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 // in case user has changed window size as
54 // restoreInitialState() overwrites these
55 int xsize = fgGetInt("/sim/startup/xsize");
56 int ysize = fgGetInt("/sim/startup/ysize");
58 build_rotmatrix(GuiQuat_mat, curGuiQuat);
59 /* check */ globals->restoreInitialState();
63 fgReshape( xsize, ysize );