1 | #ifndef __KdTreeApp_H__
|
---|
2 | #define __KdTreeApp_H__
|
---|
3 |
|
---|
4 | #include <OgreRenderTargetListener.h>
|
---|
5 | #include <ExampleApplication.h>
|
---|
6 | #include <ivreader.h>
|
---|
7 | #include "TestKdTreeAppListener.h"
|
---|
8 |
|
---|
9 | class KdTreeApp : public ExampleApplication
|
---|
10 | {
|
---|
11 | public:
|
---|
12 |
|
---|
13 | KdTreeApp() { mFrameListener = 0; }
|
---|
14 |
|
---|
15 | ~KdTreeApp()
|
---|
16 | {
|
---|
17 | delete mFrameListener;
|
---|
18 | }
|
---|
19 |
|
---|
20 | protected:
|
---|
21 | SceneNode *mCamNode;
|
---|
22 | SceneNode *mDeathNode;
|
---|
23 | Camera *mTopCam;
|
---|
24 | Camera *mFollowCam;
|
---|
25 | KdTreeAppListener *mFrameListener;
|
---|
26 |
|
---|
27 | String mSceneFiles;
|
---|
28 | String mSelectedSceneManager;
|
---|
29 | Real mMoveSpeed;
|
---|
30 | Real mRotateSpeed;
|
---|
31 | Real mRotationRadius;
|
---|
32 | Real mRotationPeriod;
|
---|
33 | int mModelSpacing;
|
---|
34 | int mModelCount;
|
---|
35 | int mRandomCount;
|
---|
36 | Real mPlaneDim;
|
---|
37 | bool mShadowsEnabled;
|
---|
38 | int mSelectEntities;
|
---|
39 |
|
---|
40 | virtual void setupResources(void);
|
---|
41 |
|
---|
42 | virtual void createScene(void);
|
---|
43 |
|
---|
44 | virtual void createFrameListener(void);
|
---|
45 |
|
---|
46 | virtual void chooseSceneManager(void);
|
---|
47 |
|
---|
48 | virtual void createCamera(void);
|
---|
49 |
|
---|
50 | virtual void createViewports(void);
|
---|
51 |
|
---|
52 | /** Configures the application - returns false if the user chooses to abandon configuration. */
|
---|
53 | virtual bool configure(void);
|
---|
54 |
|
---|
55 | bool loadScene(const String& filename);
|
---|
56 | bool loadSceneIV(const String &filename, SceneNode *root, const int index);
|
---|
57 | private:
|
---|
58 | std::string cat(std::string name, int x, int z)
|
---|
59 | {
|
---|
60 | std::stringstream s;
|
---|
61 | s.fill('0');
|
---|
62 | s << name;
|
---|
63 | s.width(2);
|
---|
64 | s << x;
|
---|
65 | s.width(2);
|
---|
66 | s << z;
|
---|
67 | return s.str();
|
---|
68 | }
|
---|
69 | };
|
---|
70 |
|
---|
71 | class KdTreeAppRenderTargetListener : public RenderTargetListener
|
---|
72 | {
|
---|
73 | public:
|
---|
74 | KdTreeAppRenderTargetListener(SceneManager *sceneMgr);
|
---|
75 |
|
---|
76 | protected:
|
---|
77 | void preViewportUpdate (const RenderTargetViewportEvent &evt);
|
---|
78 | void postRenderTargetUpdate (const RenderTargetEvent &evt);
|
---|
79 |
|
---|
80 | SceneManager *mSceneMgr;
|
---|
81 |
|
---|
82 | ShadowTechnique mSavedShadowTechnique;
|
---|
83 | ColourValue mSavedAmbientLight;
|
---|
84 | };
|
---|
85 |
|
---|
86 | #endif |
---|