- Timestamp:
- 06/27/08 13:33:46 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/RenderTraverser.h
r2800 r2801 39 39 int mNumStateChanges; 40 40 int mNumBatches; 41 42 double mRenderTime;43 41 44 42 double mWaitTime; … … 53 51 { 54 52 public: 55 53 54 /** Default constructor. 55 */ 56 RenderTraverser(); 57 /** Virtual constructor, has to be redefined in subclasses 58 */ 59 virtual ~RenderTraverser(); 60 /** Abstract method that traverses and renders the scene 61 */ 62 void RenderScene(); 63 56 64 enum {CULL_FRUSTUM, STOP_AND_WAIT, CHC, CHCPLUSPLUS, NUM_TRAVERSAL_TYPES}; 57 58 RenderTraverser(); 59 ~RenderTraverser(); 60 61 //! Renders the scene with the specified method 62 /** 63 The method is one of 65 /** Returns the type of the traversal. 66 The type is one of 64 67 CULL_FRUSTUM: view frustum culling only 65 68 STOP_AND_WAIT: hierarchical stop and wait algorithm … … 67 70 CHCPLUSPLUS: coherent hierarchical algorithm revisited 68 71 */ 69 v oid RenderScene();72 virtual int GetType() const = 0; 70 73 /** Sets the scene hierarchy. 71 74 */ … … 74 77 */ 75 78 void SetCamera(Camera *cam) {mCamera = cam;} 79 /** Sets the render queue. 80 */ 81 void SetRenderQueue(RenderQueue *rq) {mRenderQueue =rq;} 76 82 /** Renders a visualization of the hierarchy 77 83 */ … … 86 92 */ 87 93 int GetCurrentFrameId() const { return mFrameId; } 88 89 94 90 95 ////////////////// 91 96 //-- options for the different rendering algorithms … … 95 100 */ 96 101 void SetUseRenderQueue(bool useRenderQueue); 102 /** If depth pass should be used. 103 If true, the entities found visible in the current pass are stored 104 */ 105 void SetUseDepthPass(bool storeVisibleObjects); 97 106 /** Sets visible pixels threshold for visibility classification 98 107 */ 99 108 void SetVisibilityThreshold(int threshold); 100 101 109 102 110 /////////////////// 103 111 //-- CHC / CHC ++ related options 104 112 105 106 113 /** CHC optimization to query the geometry itself instead of the bounding box. 107 114 */ … … 122 129 */ 123 130 void SetShowBounds(bool showBounds); 124 125 virtual int GetType() const = 0; 126 131 /** Returns the entities found visible in current frame 132 (only if StoreVisibleObjects is set) 133 */ 134 const SceneEntityContainer &GetVisibleObjects() const { return mVisibleObjects; } 135 127 136 protected: 128 137 … … 172 181 TraversalStatistics mStats; 173 182 174 RenderQueue mRenderQueue; 183 RenderQueue *mRenderQueue; 184 185 /// the objects found visible in current frame 186 SceneEntityContainer mVisibleObjects; 175 187 176 188 … … 194 206 bool mShowBounds; 195 207 196 // timers 197 PerfTimer restTimer; 198 PerfTimer waitTimer; 199 PerfTimer queryTimer; 208 bool mUseDepthPass; 200 209 }; 201 210 … … 207 216 208 217 218 /// timers for detailed benchmarks 219 static PerfTimer restTimer; 220 static PerfTimer waitTimer; 221 static PerfTimer queryTimer; 222 209 223 } 210 224
Note: See TracChangeset
for help on using the changeset viewer.