1 | #ifndef __RunManager__ |
---|
2 | #define __RunManager__ |
---|
3 | |
---|
4 | #include "Ogre.h" |
---|
5 | #include "OgreStringConverter.h" |
---|
6 | #include "OgreException.h" |
---|
7 | |
---|
8 | #include "OgreControl.h" |
---|
9 | #include "OrxonoxScene.h" |
---|
10 | |
---|
11 | //Use this define to signify OIS will be used as a DLL |
---|
12 | //(so that dll import/export macros are in effect) |
---|
13 | #define OIS_DYNAMIC_LIB |
---|
14 | #include <OIS/OIS.h> |
---|
15 | |
---|
16 | using namespace Ogre; |
---|
17 | |
---|
18 | |
---|
19 | // let the class inherit from WindowEventListener in order for the RunMgr |
---|
20 | // to act as the central point of all the calcuations in Orxonox |
---|
21 | class RunManager : WindowEventListener |
---|
22 | { |
---|
23 | public: |
---|
24 | RunManager(OgreControl*, bool = false, bool = false, bool = false); |
---|
25 | |
---|
26 | virtual ~RunManager(); |
---|
27 | |
---|
28 | virtual bool tick(unsigned long, float); |
---|
29 | |
---|
30 | protected: |
---|
31 | OgreControl *mOgre; |
---|
32 | |
---|
33 | // these objects are meant to be static in existance. |
---|
34 | OrxonoxScene *mScene; |
---|
35 | SceneManager *mSceneMgr; |
---|
36 | Camera* mCamera; |
---|
37 | RenderWindow* mWindow; |
---|
38 | |
---|
39 | Vector3 mTranslateVector; |
---|
40 | bool mStatsOn; |
---|
41 | |
---|
42 | std::string mDebugText; |
---|
43 | |
---|
44 | unsigned int mNumScreenShots; |
---|
45 | float mMoveScale; |
---|
46 | Degree mRotScale; |
---|
47 | // just to stop toggles flipping too fast |
---|
48 | Real mTimeUntilNextToggle ; |
---|
49 | Radian mRotX, mRotY; |
---|
50 | TextureFilterOptions mFiltering; |
---|
51 | int mAniso; |
---|
52 | |
---|
53 | int mSceneDetailIndex ; |
---|
54 | Real mMoveSpeed; |
---|
55 | Degree mRotateSpeed; |
---|
56 | Overlay* mDebugOverlay; |
---|
57 | |
---|
58 | //OIS Input devices |
---|
59 | OIS::InputManager* mInputManager; |
---|
60 | OIS::Mouse* mMouse; |
---|
61 | OIS::Keyboard* mKeyboard; |
---|
62 | OIS::JoyStick* mJoy; |
---|
63 | |
---|
64 | // previously elapsed render time |
---|
65 | unsigned long mTime; |
---|
66 | |
---|
67 | virtual void createCamera(void); |
---|
68 | |
---|
69 | virtual void createViewports(void); |
---|
70 | |
---|
71 | |
---|
72 | /** EVENT HANDLING **/ |
---|
73 | |
---|
74 | //Adjust mouse clipping area |
---|
75 | virtual void windowResized(RenderWindow*); |
---|
76 | |
---|
77 | //Unattach OIS before window shutdown (very important under Linux) |
---|
78 | virtual void windowClosed(RenderWindow*); |
---|
79 | |
---|
80 | |
---|
81 | /** INPUT PROCESSING **/ |
---|
82 | virtual bool processUnbufferedKeyInput(); |
---|
83 | |
---|
84 | virtual bool processUnbufferedMouseInput(); |
---|
85 | |
---|
86 | |
---|
87 | /** OUTPUT **/ |
---|
88 | |
---|
89 | virtual void updateStats(void); |
---|
90 | |
---|
91 | virtual void moveCamera(); |
---|
92 | |
---|
93 | virtual void showDebugOverlay(bool); |
---|
94 | |
---|
95 | }; |
---|
96 | |
---|
97 | #endif |
---|