Changeset 1220 for GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE
- Timestamp:
- 08/18/06 17:25:57 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreKdTree.h
r1211 r1220 478 478 KDRM_GTP_VFC, 479 479 KDRM_GTP_SWC, 480 KDRM_GTP_CHC 481 480 KDRM_GTP_CHC, 481 // invalid modes, just for convenience 482 KDRM_SIZE, 483 KDRM_NOTSET 482 484 }; 483 485 … … 485 487 { 486 488 KDBM_RECURSIVE, 487 KDBM_PRIORITYQUEUE 488 }; 489 KDBM_PRIORITYQUEUE, 490 // invalid modes, just for convenience 491 KDBM_SIZE, 492 KDBM_NOTSET 493 }; 494 489 495 490 496 const static int HILITE_OFF = -1; -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTreeSceneManager.cpp
r1214 r1220 51 51 mIsHierarchicalCulling(false) 52 52 { 53 // Replace root node with my node54 OGRE_DELETE(mSceneRoot);55 56 mSceneRoot = new KdTreeSceneNode(this, "root node");57 mSceneRoot->_notifyRootNode(); 58 59 mHierarchyInterface = new KdTreeHierarchyInterface(this, mDestRenderSystem);53 // Replace root node with my node 54 OGRE_DELETE(mSceneRoot); 55 mSceneRoot = new KdTreeSceneNode(this, "root node"); 56 mSceneRoot->_notifyRootNode(); 57 58 // init heirarchy interface 59 mHierarchyInterface = new KdTreeHierarchyInterface(this, mDestRenderSystem); 60 60 } 61 61 … … 80 80 return mShowBoxes; 81 81 } 82 83 //void KdTreeSceneManager::setEnhancedVis(bool enhanced)84 //{85 // for (CameraList::iterator it = mCameras.begin(); it != mCameras.end(); it ++)86 // {87 // KDCAMPTR_CAST(it->second)->setEnhancedVisMode(enhanced);88 // }89 //}90 82 91 83 bool KdTreeSceneManager::setOption(const String& strKey, const void* pValue) … … 156 148 else if (strKey == "BuildMethod") 157 149 { 158 String bm = *static_cast<const String*>(pValue);159 if (bm == "PriorityQueue")160 { 161 mBuildMethod = KdTree::KDBM_PRIORITYQUEUE;150 KdTree::BuildMethod bm = *static_cast<const KdTree::BuildMethod *>(pValue); 151 if (bm == KdTree::KDBM_RECURSIVE || bm == KdTree::KDBM_PRIORITYQUEUE) 152 { 153 mBuildMethod = bm; 162 154 return true; 163 155 } 164 else if (bm == "Recursive") 165 { 166 mBuildMethod = KdTree::KDBM_RECURSIVE; 156 else 157 { 158 return false; 159 } 160 } 161 else if (strKey == "RenderMethod") 162 { 163 KdTree::RenderMethod rm = *static_cast<const KdTree::RenderMethod *>(pValue); 164 if (rm == KdTree::KDRM_INTERNAL) 165 { 166 mRenderMethod = rm; 167 167 return true; 168 168 } 169 else 170 { 171 return false; 172 } 173 } 174 else if (strKey == "RenderMethod") 175 { 176 String rm = *static_cast<const String *>(pValue); 177 if (rm == "INT") 178 { 179 mRenderMethod = KdTree::KDRM_INTERNAL; 180 return true; 181 } 182 else if (rm == "VFC") 183 { 184 mRenderMethod = KdTree::KDRM_GTP_VFC; 169 else if (rm == KdTree::KDRM_GTP_VFC) 170 { 171 mRenderMethod = rm; 185 172 int cmt = GtpVisibility::VisibilityEnvironment::FRUSTUM_CULLING; 186 173 return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface) 187 174 .setOption("Algorithm", &cmt); 188 175 } 189 else if (rm == "SWC")190 { 191 mRenderMethod = KdTree::KDRM_GTP_SWC;176 else if (rm == KdTree::KDRM_GTP_SWC) 177 { 178 mRenderMethod = rm; 192 179 int cmt = GtpVisibility::VisibilityEnvironment::STOP_AND_WAIT_CULLING; 193 180 return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface) 194 181 .setOption("Algorithm", &cmt); 195 182 } 196 else if (rm == "CHC")197 { 198 mRenderMethod = KdTree::KDRM_GTP_CHC;183 else if (rm == KdTree::KDRM_GTP_CHC) 184 { 185 mRenderMethod = rm; 199 186 int cmt = GtpVisibility::VisibilityEnvironment::COHERENT_HIERARCHICAL_CULLING; 200 187 return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface) … … 205 192 return false; 206 193 } 194 //String rm = *static_cast<const String *>(pValue); 195 //if (rm == "INT") 196 //{ 197 // mRenderMethod = KdTree::KDRM_INTERNAL; 198 // return true; 199 //} 200 //else if (rm == "VFC") 201 //{ 202 // mRenderMethod = KdTree::KDRM_GTP_VFC; 203 // int cmt = GtpVisibility::VisibilityEnvironment::FRUSTUM_CULLING; 204 // return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface) 205 // .setOption("Algorithm", &cmt); 206 //} 207 //else if (rm == "SWC") 208 //{ 209 // mRenderMethod = KdTree::KDRM_GTP_SWC; 210 // int cmt = GtpVisibility::VisibilityEnvironment::STOP_AND_WAIT_CULLING; 211 // return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface) 212 // .setOption("Algorithm", &cmt); 213 //} 214 //else if (rm == "CHC") 215 //{ 216 // mRenderMethod = KdTree::KDRM_GTP_CHC; 217 // int cmt = GtpVisibility::VisibilityEnvironment::COHERENT_HIERARCHICAL_CULLING; 218 // return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface) 219 // .setOption("Algorithm", &cmt); 220 //} 221 //else 222 //{ 223 // return false; 224 //} 207 225 } 208 226 // little hack in case someone uses "Algorithm" option from VisOptMan directly … … 362 380 if (mKdTree) 363 381 *static_cast<bool *>(pDestValue) = mKdTree->getEnhancedVis(); 364 //KDCAMPTR_CAST(mCameras.begin()->second)->getEnhancedVisMode();365 382 else 366 383 *static_cast<bool *>(pDestValue) = mEnhancedVisiblity; … … 369 386 else if (strKey == "BuildMethod") 370 387 { 371 if (mBuildMethod == KdTree::KDBM_PRIORITYQUEUE) 372 { 373 *static_cast<String *>(pDestValue) = "PriorityQueue"; 374 } 375 else if (mBuildMethod == KdTree::KDBM_RECURSIVE) 376 { 377 *static_cast<String *>(pDestValue) = "Recursive"; 378 } 388 //if (mBuildMethod == KdTree::KDBM_PRIORITYQUEUE) 389 //{ 390 // *static_cast<String *>(pDestValue) = "PriorityQueue"; 391 //} 392 //else if (mBuildMethod == KdTree::KDBM_RECURSIVE) 393 //{ 394 // *static_cast<String *>(pDestValue) = "Recursive"; 395 //} 396 *static_cast<KdTree::BuildMethod *>(pDestValue) = mBuildMethod; 379 397 return true; 380 398 } 381 399 else if (strKey == "RenderMethod") 382 400 { 383 if (mRenderMethod == KdTree::KDRM_INTERNAL) 384 { 385 *static_cast<String *>(pDestValue) = "INT"; 386 } 387 else if (mRenderMethod == KdTree::KDRM_GTP_VFC) 388 { 389 *static_cast<String *>(pDestValue) = "VFC"; 390 } 391 else if (mRenderMethod == KdTree::KDRM_GTP_SWC) 392 { 393 *static_cast<String *>(pDestValue) = "SWC"; 394 } 395 else if (mRenderMethod == KdTree::KDRM_GTP_CHC) 396 { 397 *static_cast<String *>(pDestValue) = "CHC"; 398 } 399 else 400 { 401 return false; 402 } 401 //if (mRenderMethod == KdTree::KDRM_INTERNAL) 402 //{ 403 // *static_cast<String *>(pDestValue) = "INT"; 404 //} 405 //else if (mRenderMethod == KdTree::KDRM_GTP_VFC) 406 //{ 407 // *static_cast<String *>(pDestValue) = "VFC"; 408 //} 409 //else if (mRenderMethod == KdTree::KDRM_GTP_SWC) 410 //{ 411 // *static_cast<String *>(pDestValue) = "SWC"; 412 //} 413 //else if (mRenderMethod == KdTree::KDRM_GTP_CHC) 414 //{ 415 // *static_cast<String *>(pDestValue) = "CHC"; 416 //} 417 //else 418 //{ 419 // return false; 420 //} 421 *static_cast<KdTree::RenderMethod *>(pDestValue) = mRenderMethod; 403 422 return true; 404 423 } -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp
r1193 r1220 454 454 455 455 getRenderQueue()->clear(); // finally clear render queue 456 if ( 0) OGRE_DELETE(mRenderQueue); // HACK: should rather only be cleared ...456 if (1) OGRE_DELETE(mRenderQueue); // HACK: should rather only be cleared ... 457 457 if (0) WriteLog(); // write out stats 458 458 }
Note: See TracChangeset
for help on using the changeset viewer.