- Timestamp:
- 08/18/06 17:25:57 (18 years ago)
- Location:
- GTP/trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/include/TestKdTree.h
r1204 r1220 57 57 // scene options 58 58 String mSceneFiles; 59 String mSelectedSceneManager;60 59 Real mRotationRadius; 61 60 int mModelSpacing; … … 67 66 68 67 KdTreeAppListener::Options mOptions; 69 70 68 71 69 virtual void setupResources(void); -
GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/include/TestKdTreeAppListener.h
r1215 r1220 36 36 #define __KdTreeAppListener_H__ 37 37 38 #include "Ogre.h" 39 #include "OgreKeyEvent.h" 40 #include "OgreEventListeners.h" 41 #include "OgreStringConverter.h" 42 #include "OgreException.h" 43 38 #include <Ogre.h> 39 #include <OgreKeyEvent.h> 40 #include <OgreEventListeners.h> 41 #include <OgreStringConverter.h> 42 #include <OgreException.h> 43 44 #include <OgreKdTree.h> 45 46 #define CONV_OCM_TO_KDT_ALG(i) (i == 0 ? 3 : i) 47 #define CONV_KDT_TO_OCM_ALG(i) (i % 3) 44 48 #define VIZ_VIEWPORT_Z_ORDER 10 45 49 … … 72 76 }; 73 77 78 enum SceneMgr 79 { 80 SM_KDT, 81 SM_OCM, 82 SM_OCT, 83 SM_GEN, 84 SM_SIZE, 85 SM_NOTSET 86 }; 87 74 88 enum ShowTree 75 89 { … … 90 104 { 91 105 Options(): 92 mDemoMode(false),93 mEnhancedVisibility(false),94 106 mRotateSpeed(36.0f), 95 107 mMoveSpeed(100.0f), 96 108 mRotationPeriod(30.0f), 97 mMaxDepth(12),98 109 mKT(2.0f), 99 110 mKI(1.0f), 100 mRenderMethod("CHC") 111 mMaxDepth(12), 112 mSceneManager(SM_KDT), 113 mRenderMethod(KdTree::KDRM_GTP_CHC), 114 mBuildMethod(KdTree::KDBM_PRIORITYQUEUE), 115 mDemoMode(false), 116 mEnhancedVisibility(false) 101 117 { 102 118 103 119 } 104 120 105 String mSceneManager;106 121 String mDemoInfileName; 107 122 String mDemoOutfileName; 108 123 String mDemoLogfileName; 109 bool mDemoMode; 110 bool mEnhancedVisibility; 124 String mComment; 111 125 Degree mRotateSpeed; 112 126 Real mMoveSpeed; 113 127 Real mRotationPeriod; 114 int mMaxDepth;115 128 Real mKT; 116 129 Real mKI; 117 String mRenderMethod; 118 String mComment; 130 int mMaxDepth; 131 int mSceneManager; 132 int mRenderMethod; 133 int mBuildMethod; 134 bool mDemoMode; 135 bool mEnhancedVisibility; 119 136 }; 120 137 … … 164 181 void keyReleased(KeyEvent* e) {}; 165 182 183 const static Real DEMO_WAIT; 166 184 const static String NA; 167 const static Real DEMO_WAIT; 185 const static String RENDERMETHOD[]; 186 const static String RENDERMETHODCAPTION[]; 187 const static String BUILDMETHOD[]; 188 const static String BUILDMETHODCAPTION[]; 189 const static String SCENEMANAGER[]; 190 const static String SCENEMANAGERNAME[]; 168 191 protected: 169 192 // basic -
GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/scripts/TestKdTree.vcproj
r1203 r1220 21 21 Optimization="0" 22 22 ImproveFloatingPointConsistency="TRUE" 23 AdditionalIncludeDirectories="..\include;"$(OGRE_PATH)\Samples\Common\include";"$(OGRE_PATH)\OgreMain\include";..\..\..\..\..\..\Lib\Vis\OnlineCullingCHC\IVReader\include "23 AdditionalIncludeDirectories="..\include;"$(OGRE_PATH)\Samples\Common\include";"$(OGRE_PATH)\OgreMain\include";..\..\..\..\..\..\Lib\Vis\OnlineCullingCHC\IVReader\include;..\..\..\..\..\..\Lib\Vis\OnlineCullingCHC\OGRE\include;..\..\..\..\..\..\Lib\Vis\OnlineCullingCHC\include" 24 24 PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;GTP_VISIBILITY_MODIFIED_OGRE" 25 25 MinimalRebuild="TRUE" … … 84 84 OptimizeForProcessor="2" 85 85 OptimizeForWindowsApplication="TRUE" 86 AdditionalIncludeDirectories="..\include;"$(OGRE_PATH)\Samples\Common\include";"$(OGRE_PATH)\OgreMain\include";..\..\..\..\..\..\Lib\Vis\OnlineCullingCHC\IVReader\include "86 AdditionalIncludeDirectories="..\include;"$(OGRE_PATH)\Samples\Common\include";"$(OGRE_PATH)\OgreMain\include";..\..\..\..\..\..\Lib\Vis\OnlineCullingCHC\IVReader\include;..\..\..\..\..\..\Lib\Vis\OnlineCullingCHC\OGRE\include;..\..\..\..\..\..\Lib\Vis\OnlineCullingCHC\include" 87 87 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;GTP_VISIBILITY_MODIFIED_OGRE" 88 88 StringPooling="TRUE" -
GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/src/TestKdTree.cpp
r1215 r1220 30 30 .addOpt("l","logfile", ARGUMENT_REQUIRED) 31 31 .addOpt("d","demomode", ARGUMENT_NONE) 32 .addOpt("","buildmode", ARGUMENT_REQUIRED) 32 33 .addOpt("","maxdepth", ARGUMENT_REQUIRED) 33 34 .addOpt("","kt", ARGUMENT_REQUIRED) … … 49 50 std::stringstream s; 50 51 52 if (cmdparser.getOpt("buildmode", tmp)) 53 { 54 int bm = KdTree::KDBM_NOTSET; 55 for (int i = 0; i < KdTree::KDBM_SIZE; i ++) 56 { 57 if (tmp == KdTreeAppListener::BUILDMETHOD[i]) 58 bm = i; 59 } 60 if (bm != KdTree::KDBM_NOTSET) 61 { 62 options.mBuildMethod = bm; 63 } 64 else 65 { 66 MessageBox(NULL, ("Invalid argument for option --buildmode: " + tmp).c_str(), "Error", MB_OK | MB_ICONERROR ); 67 return -1; 68 } 69 } 70 51 71 if (cmdparser.getOpt("maxdepth", tmp)) 52 72 { … … 72 92 if (cmdparser.getOpt("r",tmp)) 73 93 { 74 if (tmp == "INT" || tmp == "VFC" || tmp == "SWC" || tmp == "CHC") 75 { 76 options.mRenderMethod = tmp; 94 int rm = KdTree::KDRM_NOTSET; 95 for (int i = 0; i < KdTree::KDRM_SIZE; i ++) 96 { 97 if (tmp == KdTreeAppListener::RENDERMETHOD[i]) 98 rm = i; 99 } 100 if (rm != KdTree::KDRM_NOTSET) 101 { 102 options.mRenderMethod = rm; 77 103 } 78 104 else 79 105 { 80 MessageBox(NULL, ("Invalid argument for option --renderm ethod: " + tmp).c_str(), "Error", MB_OK | MB_ICONERROR );106 MessageBox(NULL, ("Invalid argument for option --rendermode: " + tmp).c_str(), "Error", MB_OK | MB_ICONERROR ); 81 107 return -1; 82 108 } … … 85 111 if (cmdparser.getOpt("s",tmp)) 86 112 { 87 if (tmp == "KDT" || tmp == "OCT" || tmp == "OCM" || tmp == "GEN") 88 { 89 options.mSceneManager = tmp; 113 int sm = KdTreeAppListener::SM_NOTSET; 114 for (int i = 0; i < KdTreeAppListener::SM_SIZE; i ++) 115 { 116 if (tmp == KdTreeAppListener::SCENEMANAGER[i]) 117 sm = i; 118 } 119 if (sm != KdTreeAppListener::SM_NOTSET) 120 { 121 options.mSceneManager = sm; 90 122 } 91 123 else … … 149 181 cfDeath.load("testKdTree.cfg"); 150 182 151 mSelectedSceneManager = cfDeath.getSetting("scenemanager");152 183 mSceneFiles = cfDeath.getSetting("scene"); 153 184 … … 194 225 mOptions.mDemoOutfileName = cfDeath.getSetting("demooutfile"); 195 226 196 // set default demo output name to avoid SNAFUs197 //if (mOptions.mDemoOutfileName.empty())198 // mOptions.mDemoOutfileName = "demo.bin";199 200 227 if (mOptions.mDemoLogfileName.empty()) 201 228 mOptions.mDemoLogfileName = cfDeath.getSetting("demologfile"); 202 203 // set default demo logfile name to avoid SNAFUs204 //if (mOptions.mDemoLogfileName.empty())205 // mOptions.mDemoLogfileName = "demo.csv";206 207 // override scene manager set in config file208 if (!mOptions.mSceneManager.empty())209 {210 if (mOptions.mSceneManager == "KDT")211 mSelectedSceneManager = "KdTreeSceneManager";212 else if (mOptions.mSceneManager == "OCT")213 mSelectedSceneManager = "OctreeSceneManager";214 else if (mOptions.mSceneManager == "OCM")215 mSelectedSceneManager = "OcclusionCullingSceneManager";216 else if (mOptions.mSceneManager == "GEN")217 mSelectedSceneManager = "DefaultSceneManager";218 }219 // the other way round for log220 else221 {222 if (mSelectedSceneManager == "KdTreeSceneManager")223 mOptions.mSceneManager = "KDT";224 else if (mSelectedSceneManager == "OctreeSceneManager")225 mOptions.mSceneManager = "OCT";226 else if (mSelectedSceneManager == "OcclusionCullingSceneManager")227 mOptions.mSceneManager = "OCM";228 else if (mSelectedSceneManager == "DefaultSceneManager")229 mOptions.mSceneManager = "GEN";230 }231 229 232 230 ExampleApplication::setupResources(); … … 416 414 { 417 415 // Get the SceneManager 418 mSceneMgr = mRoot->createSceneManager(mSelectedSceneManager,"MySceneManager"); 419 // set params 420 mSceneMgr->setOption("KdTreeMaxDepth", &mOptions.mMaxDepth); 421 mSceneMgr->setOption("KT", &mOptions.mKT); 422 mSceneMgr->setOption("KI", &mOptions.mKI); 423 mSceneMgr->setOption("RenderMethod", &mOptions.mRenderMethod); 424 mSceneMgr->setOption("EnhancedVisibility", &mOptions.mEnhancedVisibility); 416 mSceneMgr = mRoot->createSceneManager( 417 KdTreeAppListener::SCENEMANAGERNAME[mOptions.mSceneManager], 418 "MySceneManager"); 419 // set params depending on scene manager 420 if (mOptions.mSceneManager == KdTreeAppListener::SM_KDT) 421 { 422 mSceneMgr->setOption("BuildMethod", &mOptions.mBuildMethod); 423 mSceneMgr->setOption("KdTreeMaxDepth", &mOptions.mMaxDepth); 424 mSceneMgr->setOption("KT", &mOptions.mKT); 425 mSceneMgr->setOption("KI", &mOptions.mKI); 426 mSceneMgr->setOption("RenderMethod", &mOptions.mRenderMethod); 427 mSceneMgr->setOption("EnhancedVisibility", &mOptions.mEnhancedVisibility); 428 } 429 // set algorithm when scene manager is OCM - numbering is different though 430 if (mOptions.mSceneManager == KdTreeAppListener::SM_OCM) 431 { 432 int alg = CONV_KDT_TO_OCM_ALG(mOptions.mRenderMethod); 433 mSceneMgr->setOption("Algorithm", &alg); 434 } 425 435 } 426 436 … … 452 462 mTopCam->setDirection(0,0,-1); 453 463 mTopCam->pitch(Radian(-Math::HALF_PI)); 454 //mTopCam->setCullingFrustum(mCamera);464 mTopCam->setCullingFrustum(mCamera); 455 465 mTopCam->setNearClipDistance(1); 456 466 -
GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/src/TestKdTreeAppListener.cpp
r1215 r1220 6 6 #include <windows.h> 7 7 8 const Real KdTreeAppListener::DEMO_WAIT = 5.0; 8 9 const String KdTreeAppListener::NA = ": N/A"; 9 const Real KdTreeAppListener::DEMO_WAIT = 5.0; 10 const String KdTreeAppListener::RENDERMETHOD[] = { "INT", "VFC", "SWC", "CHC" }; 11 const String KdTreeAppListener::RENDERMETHODCAPTION[] = 12 { 13 "Internal Frustum Culling", 14 "View Frustum Culling", 15 "Stop and Wait Culling", 16 "Coherent Hierarchical Culling" 17 }; 18 const String KdTreeAppListener::BUILDMETHOD[] = { "RE", "PQ" }; 19 const String KdTreeAppListener::BUILDMETHODCAPTION[] = { "Recursive", "Priority Queue" }; 20 const String KdTreeAppListener::SCENEMANAGER[] = { "KDT", "OCM", "OCT", "GEN" }; 21 const String KdTreeAppListener::SCENEMANAGERNAME[] = 22 { 23 "KdTreeSceneManager", 24 "OcclusionCullingSceneManager", 25 "OctreeSceneManager", 26 "DefaultSceneManager" 27 }; 10 28 11 29 void KdTreeAppListener::updateStats(void) … … 220 238 const int border_height = 10; 221 239 const int vert_space = 15; 240 int top = border_height; 241 242 String ext = "KdTree/"; 222 243 String sMD, sKT, sKI, sHL, sBM, sRM, sFM, sTC, sEV; 223 224 int top = border_height;225 226 String ext = "KdTree/";227 244 228 245 int maxd; … … 252 269 sHL = ": off"; 253 270 254 Stringbm;271 int bm; 255 272 if (mSceneMgr->getOption("BuildMethod", &bm)) 256 sBM = ": " + bm;273 sBM = ": " + BUILDMETHODCAPTION[bm]; 257 274 else 258 275 sBM = NA; 259 276 260 Stringrm;277 int rm; 261 278 if (mSceneMgr->getOption("RenderMethod", &rm)) 262 { 263 if (rm == "INT") 264 sRM = ": Internal Frustum Culling"; 265 else if (rm == "VFC") 266 sRM = ": View Frustum Culling"; 267 else if (rm == "SWC") 268 sRM = ": Stop and Wait Culling"; 269 else if (rm == "CHC") 270 sRM = ": Coherent Hierarchical Culling"; 271 else 272 sRM = NA; 273 } 279 sRM = ": " + RENDERMETHODCAPTION[rm]; 274 280 else 275 281 sRM = NA; 282 283 // hack to allow mode switching in OCM 284 if (mOptions.mSceneManager == SM_OCM) 285 { 286 rm = CONV_KDT_TO_OCM_ALG(mOptions.mRenderMethod); 287 sRM = ": " + RENDERMETHODCAPTION[CONV_OCM_TO_KDT_ALG(rm)]; 288 } 276 289 277 290 bool enh; … … 430 443 void KdTreeAppListener::toggleBuildMethod() 431 444 { 432 static String bmOptions[] = { "Recursive", "PriorityQueue" }; 433 static String bmOptionCaptions[] = { ": Recursive", ": PriorityQueue" }; 434 static int bmOptionsSize = sizeof(bmOptions) / sizeof(String); 435 static int bmCurrent = 0; 436 437 String bm; 445 int bm; 446 438 447 if (mSceneMgr->getOption("BuildMethod", &bm)) 439 448 { 440 for (int idx = 0; idx < bmOptionsSize; idx++) 441 if (bmOptions[idx] == bm) 442 bmCurrent = idx; 443 bmCurrent = (bmCurrent + 1) % bmOptionsSize; 444 if (mSceneMgr->setOption("BuildMethod", &bmOptions[bmCurrent])) 445 mBuildMethodInfo->setCaption(bmOptionCaptions[bmCurrent]); 449 bm = (bm + 1) % KdTree::KDBM_SIZE; 450 if (mSceneMgr->setOption("BuildMethod", &bm)) 451 mBuildMethodInfo->setCaption(": " + BUILDMETHODCAPTION[bm]); 446 452 } 447 453 else … … 453 459 void KdTreeAppListener::toggleRenderMethod() 454 460 { 455 static String rmOptions[] = { "INT", "VFC", "SWC", "CHC" }; 456 static String rmOptionCaptions[] = 457 { 458 ": Internal Frustum Culling", 459 ": View Frustum Culling", 460 ": Stop and Wait Culling", 461 ": Coherent Hierarchical Culling" 462 }; 463 static int rmOptionsSize = sizeof(rmOptions) / sizeof (String); 464 static int rmCurrent = 0; 465 466 String rm; 461 int rm; 462 467 463 if (mSceneMgr->getOption("RenderMethod", &rm)) 468 464 { 469 for (int idx = 0; idx < rmOptionsSize; idx++) 470 if (rmOptions[idx] == rm) 471 rmCurrent = idx; 472 rmCurrent = (rmCurrent + 1) % rmOptionsSize; 473 if (mSceneMgr->setOption("RenderMethod", &rmOptions[rmCurrent])) 474 mRenderMethodInfo->setCaption(rmOptionCaptions[rmCurrent]); 465 rm = (rm + 1) % KdTree::KDRM_SIZE; 466 if (mSceneMgr->setOption("RenderMethod", &rm)) 467 mRenderMethodInfo->setCaption(": " + RENDERMETHODCAPTION[rm]); 475 468 } 476 469 else 477 470 { 478 471 mRenderMethodInfo->setCaption(NA); 472 } 473 474 // hack to allow mode switching in OCM, cannot extract setting from sm 475 if (mOptions.mSceneManager == SM_OCM) 476 { 477 static int alg = CONV_KDT_TO_OCM_ALG(mOptions.mRenderMethod); 478 alg = (alg + 1) % 3; 479 if (mSceneMgr->setOption("Algorithm", &alg)) 480 mRenderMethodInfo->setCaption(": " + RENDERMETHODCAPTION[CONV_OCM_TO_KDT_ALG(alg)]); 479 481 } 480 482 } … … 539 541 } 540 542 541 if (mInputDevice->isKeyDown(KC_ F11) && mTimeUntilNextToggle <= 0)543 if (mInputDevice->isKeyDown(KC_0) && mTimeUntilNextToggle <= 0) 542 544 { 543 545 toggleBuildMethod(); … … 1500 1502 { 1501 1503 // demo settings 1502 logwrite << mOptions.mSceneManager;1503 if (mOptions.mSceneManager == "KDT")1504 { 1505 logwrite << ds << mOptions.mRenderMethod<< ds << mOptions.mMaxDepth << ds1504 logwrite << SCENEMANAGER[mOptions.mSceneManager]; 1505 if (mOptions.mSceneManager == SM_KDT) 1506 { 1507 logwrite << ds << RENDERMETHOD[mOptions.mRenderMethod] << ds << mOptions.mMaxDepth << ds 1506 1508 << mOptions.mKT << ds << mOptions.mKI; 1507 1509 } 1508 //else if (mOptions.mSceneManager == "OCM" && mOptions.mRenderMethod != "INT")1509 //{1510 // logwrite << ds << mOptions.mRenderMethod;1511 //}1510 else if (mOptions.mSceneManager == SM_OCM && mOptions.mRenderMethod != KdTree::KDRM_INTERNAL) 1511 { 1512 logwrite << ds << RENDERMETHOD[(mOptions.mRenderMethod+3)%3]; 1513 } 1512 1514 logwrite << fs; 1513 1515 // per second stats -
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.