- Timestamp:
- 10/05/07 15:36:52 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOctreeHierarchyInterface.cpp
r2455 r2555 32 32 Octree *nextChild; 33 33 34 for (int z = 0; z < 2; ++ z) 35 { 36 for (int y = 0; y < 2; ++ y) 37 { 38 for (int x = 0; x < 2; ++ x) 39 { 40 nextChild = octree->mChildren[x][y][z]; 41 42 if (nextChild) 43 GetQueue()->push(nextChild); 44 } 45 } 46 } 34 nextChild = octree->mChildren[0][0][0]; if (nextChild) GetQueue()->push(nextChild); 35 nextChild = octree->mChildren[1][0][0]; if (nextChild) GetQueue()->push(nextChild); 36 nextChild = octree->mChildren[0][1][0]; if (nextChild) GetQueue()->push(nextChild); 37 nextChild = octree->mChildren[1][1][0]; if (nextChild) GetQueue()->push(nextChild); 38 nextChild = octree->mChildren[0][0][1]; if (nextChild) GetQueue()->push(nextChild); 39 nextChild = octree->mChildren[1][0][1]; if (nextChild) GetQueue()->push(nextChild); 40 nextChild = octree->mChildren[0][1][1]; if (nextChild) GetQueue()->push(nextChild); 41 nextChild = octree->mChildren[1][1][1]; if (nextChild) GetQueue()->push(nextChild); 42 } 43 } 44 //----------------------------------------------------------------------- 45 void OctreeHierarchyInterface::TraverseNode2(GtpVisibility::HierarchyNode *node) 46 { 47 ++ mNumTraversedNodes; 48 49 Octree *octree = static_cast<Octree *>(node); 50 51 // if we come across some renderable geometry => render it 52 if (!octree->mNodes.empty()) 53 { 54 AddToQueue(node); 55 } 56 57 // if not all subtrees are empty 58 if (!IsLeaf(node)) 59 { 60 Octree *nextChild; 61 62 nextChild = octree->mChildren[0][0][0]; if (nextChild) GetQueue()->push(nextChild); 63 nextChild = octree->mChildren[1][0][0]; if (nextChild) GetQueue()->push(nextChild); 64 nextChild = octree->mChildren[0][1][0]; if (nextChild) GetQueue()->push(nextChild); 65 nextChild = octree->mChildren[1][1][0]; if (nextChild) GetQueue()->push(nextChild); 66 nextChild = octree->mChildren[0][0][1]; if (nextChild) GetQueue()->push(nextChild); 67 nextChild = octree->mChildren[1][0][1]; if (nextChild) GetQueue()->push(nextChild); 68 nextChild = octree->mChildren[0][1][1]; if (nextChild) GetQueue()->push(nextChild); 69 nextChild = octree->mChildren[1][1][1]; if (nextChild) GetQueue()->push(nextChild); 47 70 } 48 71 } … … 195 218 if (octant->lastRendered() != mFrameId) 196 219 { 220 mTestMode = false; 221 197 222 octant->setLastRendered(mFrameId); 198 223 OctreeSceneManager *ocm = 199 224 static_cast<OctreeSceneManager *>(mSceneManager); 200 225 201 ocm->_ renderOctant(mCamera,226 ocm->_addOctantToQueue(mCamera, 202 227 octant, 203 228 mOnlyShadowCasters, 204 229 mLeavePassesInQueue); 205 230 231 ocm->_renderOctant(mLeavePassesInQueue); 232 206 233 mVisibleNodes.push_back(node); 207 234 } 235 #endif 236 } 237 //----------------------------------------------------------------------- 238 void OctreeHierarchyInterface::AddToQueue(GtpVisibility::HierarchyNode *node) 239 { 240 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 241 Octree *octant = static_cast<Octree *>(node); 242 243 if (octant->lastRendered() != mFrameId) 244 { 245 OctreeSceneManager *ocm = 246 static_cast<OctreeSceneManager *>(mSceneManager); 247 248 octant->setLastRendered(mFrameId); 249 250 ocm->_addOctantToQueue(mCamera, 251 octant, 252 mOnlyShadowCasters, 253 mLeavePassesInQueue); 254 255 mVisibleNodes.push_back(node); 256 } 257 #endif 258 } 259 //----------------------------------------------------------------------- 260 void OctreeHierarchyInterface::RenderQueue() 261 { 262 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 263 mTestMode = false; 264 265 OctreeSceneManager *ocm = 266 static_cast<OctreeSceneManager *>(mSceneManager); 267 ocm->_renderOctant(mLeavePassesInQueue); 208 268 #endif 209 269 }
Note: See TracChangeset
for help on using the changeset viewer.