Changeset 42 for trunk/VUT/OcclusionCullingSceneManager/include
- Timestamp:
- 04/12/05 10:50:19 (20 years ago)
- Location:
- trunk/VUT/OcclusionCullingSceneManager/include
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/OcclusionCullingSceneManager/include/OgreOcclusionCullingSceneTraverser.h
r41 r42 58 58 59 59 @param cam current camera 60 @param root root of hierarchy61 60 */ 62 void renderScene( Camera *cam , SceneNode *root);61 void renderScene( Camera *cam ); 63 62 64 65 63 /** Sets the given option for the scene traverser. 66 64 @remarks … … 84 82 void setRenderSystem( RenderSystem *rsys ); 85 83 86 /** Doing some necessary preprocessing.87 @comment e.g., initialises occlusion queries */88 void preprocess( void );89 90 84 /** Sets the current number of scene nodes in the scene. 91 85 @param num number of scene nodes … … 93 87 void setNumSceneNodes(int num ); 94 88 89 /** Sets the root of the scene hierarchy. */ 90 void setSceneRoot(SceneNode *root); 91 95 92 /** Sets the required number of occlusion queries. 96 93 @param num number occlusion queries 97 94 */ 98 void setNumQueries( int num ); 95 //void setNumQueries( int num ); 96 97 /** Doing some necessary preprocessing. 98 @comment e.g., initialises occlusion queries */ 99 //void preprocess( void ); 99 100 100 101 protected: … … 113 114 /** Sets rendering mode, e.g. query mode or render mode*/ 114 115 void setRenderingMode( int mode ); 116 117 115 118 /** Renders the scene with view frustum culling only. */ 116 v oid renderCullFrustum( Camera *cam );119 virtual void renderCullFrustum( Camera *cam ); 117 120 /** Renders the scene with the hierarchical stop and wait algorithm. */ 118 v oid renderStopAndWait( Camera *cam );121 virtual void renderStopAndWait( Camera *cam ); 119 122 /** Renders the scene with the coherent hierarchical algorithm and the query queye. */ 120 void renderCoherentWithQueue( Camera *cam ); 123 virtual void renderCoherentWithQueue( Camera *cam ); 124 121 125 /** Issue a occlusion query for this node. 122 126 @param box the axis aligned bounding box of the node … … 124 128 */ 125 129 HardwareOcclusionQuery *issueOcclusionQuery( AxisAlignedBox *box, bool wasVisible ); 130 /** Returns next available occlusion query or creates new one. 131 @return the next occlusion query 132 */ 133 HardwareOcclusionQuery *getNextOcclusionQuery(void); 126 134 /** Pulls up the visibility from the child nodes. */ 127 void pullUpVisibility( SceneNode *node );135 void pullUpVisibility( Camera *cam, SceneNode *node ); 128 136 /** delete all previously defined occlusion queries */ 129 137 void deleteQueries(); … … 136 144 SolidHalfBoundingBox *getSolidHalfBoundingBox( int half ); 137 145 138 / / we use a priority queue rather than a renderstack139 PriorityQueue *mDistanceQueue;146 /** Initialises the distance queue. */ 147 virtual void initDistanceQueue(Camera *cam); 140 148 141 149 std::vector<HardwareOcclusionQuery *> mOcclusionQueries; … … 150 158 SceneManager *mSceneManager; 151 159 RenderSystem *mRenderSystem; 152 160 153 161 int mCurrentTestIdx; 154 162 int mQueryMode; … … 162 170 unsigned int mNumFrustumCulledNodes; 163 171 unsigned int mNumRenderedGeometry; 172 173 private: 174 // the scene root 175 SceneNode *mSceneRoot; 176 // we use a priority queue ordered by distance 177 PriorityQueue *mDistanceQueue; 164 178 }; 165 179 -
trunk/VUT/OcclusionCullingSceneManager/include/OgreOcclusionCullingTerrainSceneManager.h
r41 r42 58 58 @param root current octree 59 59 */ 60 unsigned int countOctreeSize(Octree *root);60 //unsigned int countOctreeSize(Octree *root); 61 61 62 62 OcclusionCullingTerrainSceneTraverser *mOcclusionCullingTerrainSceneTraverser; 63 //OcclusionCullingSceneTraverser *mOcclusionCullingTerrainSceneTraverser;64 63 }; 65 64 -
trunk/VUT/OcclusionCullingSceneManager/include/OgreOcclusionCullingTerrainSceneTraverser.h
r41 r42 41 41 typedef pair<Octree *, HardwareOcclusionQuery *> OctreeQueryPair; 42 42 typedef priority_queue<Octree *, vector<Octree *>, octreeless<vector<Octree *>::value_type> > OctreePriorityQueue; 43 //typedef queue<QueryPair>QueryQueue;43 typedef queue<OctreeQueryPair> OctreeQueryQueue; 44 44 45 45 class OcclusionCullingTerrainSceneTraverser: public OcclusionCullingSceneTraverser … … 47 47 public: 48 48 OcclusionCullingTerrainSceneTraverser(SceneManager *sm, RenderSystem *rsys); 49 void renderScene( Camera *cam, Octree *root ); 49 ~OcclusionCullingTerrainSceneTraverser(); 50 //void renderScene( Camera *cam ); 51 void setSceneRoot(Octree *root); 52 /** Sets the number of nodes in this octree 53 @remark do not confuse this with the OctreeNode class 54 which is derived from SceneNode 55 @param num number of nodes in the octree 56 */ 57 void setNumOctreeNodes( unsigned int num ); 58 59 /** Gets the given option for the scene traverser. 60 @remarks 61 See setOption 62 */ 63 bool getOption( const String &, void * ); 64 bool getOptionKeys( StringVector &refKeys ); 50 65 51 66 protected: … … 58 73 /** Issue a occlusion query for this node. */ 59 74 60 void pullUpVisibility( Octree *octree ); 75 void initDistanceQueue(Camera *cam); 76 void pullUpVisibility( Camera *cam, Octree *octree ); 61 77 void traverseOctant(Camera *cam, Octree *octant ); 62 78 void renderOctant( Camera *cam, Octree *octant ); 79 bool isLeaf(Octree *octant); 63 80 64 OctreePriorityQueue *mDistanceQueue; 81 private: 82 OctreePriorityQueue *mOctreeDistanceQueue; 83 // the octree root 84 Octree *mOctreeSceneRoot; 85 86 unsigned int mNumOctreeNodes; 65 87 }; 66 88
Note: See TracChangeset
for help on using the changeset viewer.