Changeset 2259 for GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE
- Timestamp:
- 03/18/07 01:27:51 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreBvHierarchyInterface.h
r2258 r2259 97 97 void TraverseNode2(GtpVisibility::HierarchyNode *node) {} 98 98 bool IsNodeFullyVisible(GtpVisibility::HierarchyNode *node) const { return false;} 99 GtpVisibility::HierarchyNode *GetRandomLeaf(GtpVisibility::HierarchyNode *root) { return NULL;} 99 100 }; 100 101 -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreKdTreeHierarchyInterface.h
r2258 r2259 96 96 void DetermineFullVisibility(GtpVisibility::HierarchyNode *node) const {} 97 97 98 void TraverseNode2(GtpVisibility::HierarchyNode *node) ;98 void TraverseNode2(GtpVisibility::HierarchyNode *node) {} 99 99 100 HierarchyNode *GetRandomLeaf() { return NULL;}100 GtpVisibility::HierarchyNode *GetRandomLeaf(GtpVisibility::HierarchyNode *root) { return NULL;} 101 101 102 102 bool IsNodeFullyVisible(GtpVisibility::HierarchyNode *node) const { return false;} 103 103 104 }; 104 105 -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOctreeHierarchyInterface.h
r2258 r2259 55 55 void TraverseNode2(GtpVisibility::HierarchyNode *node); 56 56 57 HierarchyNode *GetRandomLeaf();57 GtpVisibility::HierarchyNode *GetRandomLeaf(GtpVisibility::HierarchyNode *node); 58 58 59 59 bool IsNodeFullyVisible(GtpVisibility::HierarchyNode *node) const; 60 60 61 void RenderNodeRecursive(GtpVisibility::HierarchyNode *node); 62 63 61 64 protected: 65 62 66 /** Returns pointer to the bounding box of the node. 63 67 @param node current hierarchy node -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreSceneNodeHierarchyInterface.h
r2258 r2259 48 48 void DetermineFullVisibility(GtpVisibility::HierarchyNode *node) const {} 49 49 void TraverseNode2(GtpVisibility::HierarchyNode *node) {} 50 HierarchyNode *GetRandomLeaf() { return NULL;}50 GtpVisibility::HierarchyNode *GetRandomLeaf(GtpVisibility::HierarchyNode *root) { return NULL;} 51 51 bool IsNodeFullyVisible(GtpVisibility::HierarchyNode *node) const { return false;} 52 52 -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOctreeHierarchyInterface.cpp
r2258 r2259 51 51 } 52 52 //----------------------------------------------------------------------- 53 HierarchyNode *OctreeHierarchyInterface::GetRandomLeaf()53 GtpVisibility::HierarchyNode *OctreeHierarchyInterface::GetRandomLeaf(GtpVisibility::HierarchyNode *root) 54 54 { 55 return NULL; 56 } 57 //----------------------------------------------------------------------- 58 bool OctreeHierarchyInterface::GIsNodeFullyVisible(GtpVisibility::HierarchyNode *node) const 59 { 60 return static_cast<Octree *>(node)->isOctreeFullyVisible(); 55 if (IsLeaf(root)) 56 return root; 57 58 Octree *octree = static_cast<Octree *>(root); 59 60 int mask = (int) (rand() * 8); 61 62 // random decision 63 Octree *child = octree->mChildren[mask & 1][mask & 2][mask & 3]; 64 65 return GetRandomLeaf(child); 61 66 } 62 67 //----------------------------------------------------------------------- … … 214 219 } 215 220 //----------------------------------------------------------------------- 221 void OctreeHierarchyInterface::RenderNodeRecursive(GtpVisibility::HierarchyNode *node) 222 { 223 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 224 Octree *octant = static_cast<Octree *>(node); 225 226 if (octant->lastRendered() != mFrameId) 227 { 228 octant->setLastRendered(mFrameId); 229 OctreeSceneManager *ocm = 230 static_cast<OctreeSceneManager *>(mSceneManager); 231 232 ocm->_renderOctantRecursive(mCamera, 233 octant, 234 mOnlyShadowCasters, 235 mLeavePassesInQueue); 236 237 mVisibleNodes.push_back(node); 238 } 239 #endif 240 } 241 //----------------------------------------------------------------------- 216 242 bool OctreeHierarchyInterface::IsNodeVisible(GtpVisibility::HierarchyNode *node) const 217 243 { … … 223 249 } 224 250 //----------------------------------------------------------------------- 251 bool OctreeHierarchyInterface::IsNodeFullyVisible(GtpVisibility::HierarchyNode *node) const 252 { 253 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 254 return static_cast<Octree *>(node)->isOctreeFullyVisible(); 255 #else 256 return true; 257 #endif 258 } 259 //----------------------------------------------------------------------- 225 260 unsigned int OctreeHierarchyInterface::LastVisited(GtpVisibility::HierarchyNode *node) const 226 261 {
Note: See TracChangeset
for help on using the changeset viewer.