Changeset 1204 for GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/include
- Timestamp:
- 08/15/06 22:47:29 (18 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/include
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/include/TestKdTree.h
r1202 r1204 27 27 public: 28 28 29 KdTreeApp() 30 { 31 mFrameListener = 0; 32 mRenderTargerListener = 0; 29 KdTreeApp() : 30 mFrameListener(0), 31 mRenderTargerListener(0) 32 { 33 33 34 } 34 35 35 KdTreeApp(const String& infile, const String& outfile) 36 { 37 mFrameListener = 0; 38 mRenderTargerListener = 0; 39 mDemoInfileName = infile; 40 mDemoOutfileName = outfile; 36 KdTreeApp(const KdTreeAppListener::Options& options) : 37 mFrameListener(0), 38 mRenderTargerListener(0), 39 mOptions(options) 40 { 41 41 } 42 42 … … 48 48 49 49 protected: 50 SceneNode *mCamNode;51 SceneNode *mDeathNode;52 Camera *mTopCam;53 Camera *mFollowCam;54 50 KdTreeAppListener *mFrameListener; 55 51 KdTreeAppRenderTargetListener *mRenderTargerListener; 52 SceneNode *mCamNode; 53 SceneNode *mMoveNode; 54 Camera *mTopCam; 55 //Camera *mFollowCam; 56 56 57 // scene options 57 58 String mSceneFiles; 58 59 String mSelectedSceneManager; 59 Real mMoveSpeed;60 Real mRotateSpeed;61 60 Real mRotationRadius; 62 Real mRotationPeriod;63 61 int mModelSpacing; 64 62 int mModelCount; … … 68 66 int mSelectEntities; 69 67 70 String mDemoInfileName;71 String mDemoOutfileName; 68 KdTreeAppListener::Options mOptions; 69 72 70 73 71 virtual void setupResources(void); -
GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/include/TestKdTreeAppListener.h
r1202 r1204 61 61 class KdTreeAppListener: public FrameListener, public KeyListener 62 62 { 63 64 public: 65 // visualization modes for scene nodes 66 enum VizMode 67 { 68 NODEVIZ_NONE, 69 NODEVIZ_RENDER_NODES, 70 NODEVIZ_RENDER_NODES_AND_CONTENT, 71 NODEVIZ_MODES_NUM 72 }; 73 74 enum AppState 75 { 76 AS_NORMAL, 77 AS_RECORD, 78 AS_PLAYBACK 79 }; 80 81 struct Options 82 { 83 Options(): 84 mDemoMode(false), 85 mRotateSpeed(36.0f), 86 mMoveSpeed(100.0f), 87 mRotationPeriod(30.0f), 88 mMaxDepth(12), 89 mKT(2.0f), 90 mKI(1.0f), 91 mRenderMethod("CHC") 92 { 93 94 } 95 96 String mDemoInfileName; 97 String mDemoOutfileName; 98 String mDemoLogfileName; 99 bool mDemoMode; 100 Degree mRotateSpeed; 101 Real mMoveSpeed; 102 Real mRotationPeriod; 103 int mMaxDepth; 104 Real mKT; 105 Real mKI; 106 String mRenderMethod; 107 }; 108 109 // Constructor takes a RenderWindow because it uses that to determine input context 110 KdTreeAppListener(RenderWindow* win, SceneManager* sm, const Options& options, 111 bool useBufferedInputKeys = false, bool useBufferedInputMouse = false); 112 113 virtual ~KdTreeAppListener(); 114 115 void initOverlayElement(OverlayElement **elInfo, String ext, 116 String name, int top, String caption); 117 118 void initStatsOverlay(); 119 120 void initKdTreeOverlay(); 121 122 void showDebugOverlay(bool show); 123 124 void toggleVizCamera(); 125 126 virtual bool processUnbufferedKeyInput(const FrameEvent& evt); 127 128 bool processUnbufferedMouseInput(const FrameEvent& evt); 129 130 void moveCamera(); 131 132 // Override frameStarted event to process that (don't care about frameEnded) 133 bool frameStarted(const FrameEvent& evt); 134 135 bool frameEnded(const FrameEvent& evt); 136 137 void switchMouseMode(); 138 139 void switchKeyMode(); 140 141 void keyClicked(KeyEvent* e); 142 143 void keyPressed(KeyEvent* e) {}; 144 void keyReleased(KeyEvent* e) {}; 145 146 63 147 protected: 64 int mSceneDetailIndex ; 65 Real mMoveSpeed; 66 Degree mRotateSpeed; 67 Real mRotationPeriod; 148 // basic 149 RenderWindow* mWindow; 150 SceneManager *mSceneMgr; 151 Options mOptions; 152 bool mUseBufferedInputKeys, mUseBufferedInputMouse, mInputTypeSwitchingOn; 153 154 // elements 155 SceneNode *mCamNode; 156 Camera* mCamera; 157 Camera* mTopCam; 158 159 // toggle 160 bool mStatsOn; 161 162 bool mVizCamera; 68 163 bool mShowTree; 69 164 bool mFreeMove; 70 165 bool mTopCamFollow; 71 166 167 // counters 168 int mSeqNum; 169 unsigned int mNumScreenShots; 170 171 // rendering/texture options 172 int mSceneDetailIndex; 173 TextureFilterOptions mFiltering; 174 int mAniso; 175 176 // chc stats 72 177 Real mDelayedQueriesIssued; 73 178 Real mDelayedTraversedNodes; 74 179 75 int mSeqNum; 76 77 Overlay* mDebugOverlay; 78 Overlay* mKdTreeOverlay; 180 // overlays 181 Overlay *mDemoOverlay; 182 Overlay *mDebugOverlay; 183 Overlay *mKdTreeOverlay; 184 185 OverlayElement *mDemoStatus; 79 186 80 187 OverlayElement *mKdTreeMaxDepthInfo; … … 95 202 OverlayElement *mQueriesIssuedInfo; 96 203 204 // input 97 205 EventProcessor* mEventProcessor; 98 206 InputReader* mInputDevice; 99 SceneNode *mCamNode; 100 Camera* mCamera; 101 Camera* mTopCam; 102 SceneManager *mSceneMgr; 103 Radian mDeathAngle; 104 207 208 // movement 105 209 Vector3 mTranslateVector; 106 RenderWindow* mWindow; 107 bool mStatsOn; 108 bool mUseBufferedInputKeys, mUseBufferedInputMouse, mInputTypeSwitchingOn; 109 unsigned int mNumScreenShots; 210 Vector3 mVizCamTransVect; 211 Radian mRotX, mRotY; 110 212 float mMoveScale; 111 213 Degree mRotScale; 214 Radian mDeathAngle; 215 112 216 // just to stop toggles flipping too fast 113 217 Real mTimeUntilNextToggle ; 114 Radian mRotX, mRotY;115 TextureFilterOptions mFiltering;116 int mAniso;117 118 // stuff for the viz camera119 bool mVizCamera;120 Vector3 mVizCamTransVect;121 122 void updateStats(void);123 218 124 219 // stuff for walkthrough recording/playback 125 String mDemoInfileName; 126 String mDemoOutfileName; 127 128 enum AppState 129 { 130 AS_NORMAL, 131 AS_RECORD, 132 AS_PLAYBACK 133 }; 134 220 //std::ofstream mDemoFramesLog; 221 std::list<Real> mDemoFPS; 222 Real mTimeUntilNextLogWrite; 135 223 FrameList mFrameList; 136 224 FrameList::iterator mCurrFrame; 137 225 Real mTimeRemaining; 226 Real mWaitBeforeDemoStart; 138 227 139 228 AppState mAppState; 140 141 Overlay * mDemoOverlay;142 OverlayElement * mDemoStatus;143 229 144 230 void setDemoOverlay(); … … 148 234 149 235 void saveFrameInfo(Real elapsedTime); 150 236 151 237 /** save demo frame data to file **/ 152 238 static void saveFrames(const String& filename, FrameList& framelist); … … 159 245 static void loadFramesBinary(const String& filename, FrameList& framelist); 160 246 161 public: 162 // visualization modes for scene nodes 163 enum 164 { 165 NODEVIZ_NONE, 166 NODEVIZ_RENDER_NODES, 167 NODEVIZ_RENDER_NODES_AND_CONTENT, 168 NODEVIZ_MODES_NUM 169 }; 170 171 // Constructor takes a RenderWindow because it uses that to determine input context 172 KdTreeAppListener(RenderWindow* win, SceneManager* sm, Real rs, Real ms, Real rp, 173 const String& infile, const String& outfile, 174 bool useBufferedInputKeys = false, bool useBufferedInputMouse = false); 175 176 virtual ~KdTreeAppListener(); 177 178 void initOverlayElement(OverlayElement **elInfo, String ext, 179 String name, int top, String caption); 180 181 void initStatsOverlay(); 182 183 void initKdTreeOverlay(); 184 185 void showDebugOverlay(bool show); 186 187 void toggleVizCamera(); 188 189 virtual bool processUnbufferedKeyInput(const FrameEvent& evt); 190 191 bool processUnbufferedMouseInput(const FrameEvent& evt); 192 193 void moveCamera(); 194 195 // Override frameStarted event to process that (don't care about frameEnded) 196 bool frameStarted(const FrameEvent& evt); 197 198 bool frameEnded(const FrameEvent& evt); 199 200 void switchMouseMode(); 201 202 void switchKeyMode(); 203 204 void keyClicked(KeyEvent* e); 205 206 void keyPressed(KeyEvent* e) {}; 207 void keyReleased(KeyEvent* e) {}; 247 void updateStats(void); 208 248 }; 209 249
Note: See TracChangeset
for help on using the changeset viewer.