- Timestamp:
- 08/09/06 17:08:34 (18 years ago)
- Location:
- GTP/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/src/TestKdTreeAppListener.cpp
r1188 r1192 208 208 209 209 int hl; 210 if (mSceneMgr->getOption("Hi ghlightLevel", &hl))210 if (mSceneMgr->getOption("HiLiteLevel", &hl)) 211 211 sHL = ": " + StringConverter::toString(hl); 212 212 else … … 373 373 mKdTreeMaxDepthInfo->setCaption(": " + StringConverter::toString(currdepth)); 374 374 int hl; 375 if (mSceneMgr->getOption("Hi ghlightLevel", &hl))375 if (mSceneMgr->getOption("HiLiteLevel", &hl)) 376 376 mHighlightLevelInfo->setCaption(": " + StringConverter::toString(hl)); 377 377 else … … 394 394 { 395 395 int hl; 396 if (mSceneMgr->getOption("Hi ghlightLevel", &hl))396 if (mSceneMgr->getOption("HiLiteLevel", &hl)) 397 397 { 398 398 if (mInputDevice->isKeyDown(KC_3)) … … 401 401 hl++; 402 402 403 if (mSceneMgr->setOption("Hi ghlightLevel", &hl))403 if (mSceneMgr->setOption("HiLiteLevel", &hl)) 404 404 mHighlightLevelInfo->setCaption(": " + StringConverter::toString(hl)); 405 405 } … … 600 600 { 601 601 int hl; 602 if (mSceneMgr->getOption("Hi ghlightLevel", &hl))602 if (mSceneMgr->getOption("HiLiteLevel", &hl)) 603 603 mHighlightLevelInfo->setCaption(": " + StringConverter::toString(hl)); 604 604 else … … 621 621 { 622 622 bool toggleShow; 623 mSceneMgr->getOption("ShowNode AABB", &toggleShow);623 mSceneMgr->getOption("ShowNodes", &toggleShow); 624 624 toggleShow = !toggleShow; 625 mSceneMgr->setOption("ShowNode AABB", &toggleShow);625 mSceneMgr->setOption("ShowNodes", &toggleShow); 626 626 mTimeUntilNextToggle = 0.2; 627 627 } -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreKdTree.h
r1190 r1192 192 192 { 193 193 public: 194 Node(int level, AxisAlignedBox& aabb, Branch * parent): 194 Node(KdTree * owner, int level, AxisAlignedBox& aabb, Branch * parent): 195 mOwner(owner), 195 196 mLevel(level), 196 197 mAABB(aabb), … … 208 209 virtual bool hasGeometry() const = 0; 209 210 211 // Gets this node's parent (NULL if this is the root). 212 Node *getParent(void) const { return mParent; }; 213 // Gets the nodes left & right child nodes, or NULL if not present 214 // or node is leaf 215 virtual Node *getLeftChild(void) const = 0; 216 virtual Node *getRightChild(void) const = 0; 217 218 // returns the level the node is on 219 int getLevel(void) const { return mLevel; }; 220 210 221 virtual void queueVisibleObjects(unsigned long currentFrame, 211 222 Camera* cam, RenderQueue* queue, bool onlyShadowCasters, bool showBoxes) = 0; 212 223 213 // consider using typesafe callback functions 214 //virtual void cbInsert(KdTree * caller, KdRenderable * rend) = 0; 215 216 WireBoundingBox * getWireBoundingBox(bool node = true) 224 WireBoundingBox * getWireBoundingBox() 217 225 { 218 226 if (mWBB == 0) 219 227 mWBB = new WireBoundingBox(); 220 228 221 if ( node)229 if (mOwner->getShowNodes()) 222 230 mWBB->setupBoundingBox(mAABB); 223 231 else 224 232 mWBB->setupBoundingBox(mWorldAABB); 233 234 if (mOwner->getHiLiteLevel() == mLevel) 235 mWBB->setMaterial("KdTree/BoxHiLite"); 236 else 237 mWBB->setMaterial("BaseWhiteNoLighting"); 225 238 226 #ifdef KDTREE_DEBUG227 SceneManager * sceneManager = Root::getSingleton()._getCurrentSceneManager();228 int level = -1;229 bool boxes = false;230 if (sceneManager->getOption("HighlightLevel",&level))231 {232 if (mLevel == level)233 {234 mWBB->setMaterial("KdTree/BoxHiLite");235 return mWBB;236 }237 else238 {239 mWBB->setMaterial("BaseWhiteNoLighting");240 if (sceneManager->getOption("ShowAllBoxes", &boxes))241 {242 if (boxes)243 return mWBB;244 else245 return 0;246 }247 }248 }249 #else250 mWBB->setMaterial("BaseWhiteNoLighting");251 #endif // KDTREE_DEBUG252 239 return mWBB; 253 240 … … 277 264 */ 278 265 void setLastRendered(unsigned int frameid) { mLastRendered = frameid; }; 279 /** Gets this node's parent (NULL if this is the root).280 */281 KdTree::Branch *getParent(void) { return mParent; };282 266 /** Returns real extent of the kdtree, i.e., the merged extent of the bounding boxes. 283 267 */ … … 287 271 virtual void _updateBounds(bool recurse = true) = 0; 288 272 289 Branch * mParent;290 int mLevel;291 273 AxisAlignedBox mAABB; 292 274 … … 295 277 AxisAlignedBox mWorldAABB; 296 278 protected: 279 KdTree * mOwner; 280 Branch * mParent; 281 int mLevel; 282 297 283 WireBoundingBox * mWBB; 298 284 … … 305 291 { 306 292 public: 307 Branch(int level, AxisAlignedBox& aabb, Branch * parent, Plane * splitplane, PlaneEvent::Side side): 308 Node(level, aabb, parent), 309 mSplitPlane(splitplane), 310 mLeft(0), 311 mRight(0), 312 mPlaneSide(side) 293 Branch(KdTree * owner, int level, AxisAlignedBox& aabb, Branch * parent, 294 Plane * splitplane, PlaneEvent::Side side): 295 Node(owner, level, aabb, parent), 296 mSplitPlane(splitplane), 297 mLeft(0), 298 mRight(0), 299 mPlaneSide(side) 313 300 { }; 314 301 … … 329 316 virtual bool hasGeometry() const { return false; }; 330 317 318 // a branch should have at least one child 319 virtual Node * getLeftChild() const { return mLeft; }; 320 virtual Node * getRightChild() const { return mRight; }; 321 331 322 virtual void queueVisibleObjects(unsigned long currentFrame, 332 323 Camera* cam, RenderQueue* queue, bool onlyShadowCasters, bool showBoxes) 333 324 { 334 325 if (showBoxes) 335 { 336 WireBoundingBox * wbb = getWireBoundingBox(); 337 if (wbb) 338 queue->addRenderable(wbb); 339 } 326 if (mLevel == mOwner->getHiLiteLevel() || mOwner->getShowAllBoxes()) 327 queue->addRenderable(getWireBoundingBox()); 340 328 } 341 329 … … 365 353 { 366 354 public: 367 Leaf( int level, AxisAlignedBox& aabb, Branch * parent):368 Node(level, aabb, parent)355 Leaf(KdTree * owner, int level, AxisAlignedBox& aabb, Branch * parent): 356 Node(owner, level, aabb, parent) 369 357 {}; 370 358 … … 379 367 // a leaf has geometry when it has renderables 380 368 virtual bool hasGeometry() const { return !mKdRenderables.empty(); }; 369 370 // a leaf never has children 371 virtual Node * getLeftChild() const { return 0; }; 372 virtual Node * getRightChild() const { return 0; }; 381 373 382 374 virtual void queueVisibleObjects(unsigned long currentFrame, … … 478 470 KDBM_PRIORITYQUEUE 479 471 }; 472 473 const static int HILITE_OFF = -1; 480 474 481 KdTree(int maxdepth); 475 KdTree(int maxdepth, BuildMethod bm); 476 KdTree(int maxdepth, BuildMethod bm, int hilite, bool allboxes, bool shownodes); 482 477 virtual ~KdTree(); 483 478 … … 486 481 Real calcCost(void); 487 482 488 /** Switches between displaying the bounding box of the node and 489 the box of the contained scene nodes 490 */ 491 inline void setShowNodeAABB(bool show = true) { mShowNodeAABB = show; }; 492 inline bool getShowNodeAABB(void) { return mShowNodeAABB; }; 483 // sets the level to highlight or turns it off (when hilite < 0) 484 inline void setHiLiteLevel(int hilite) { mHiLiteLevel = hilite; }; 485 inline int getHiLiteLevel(void) { return mHiLiteLevel; }; 486 487 // toggles displaying the kdtree boxes 488 inline void setShowAllBoxes(bool show) { mShowAllBoxes = show; }; 489 inline bool getShowAllBoxes(void) { return mShowAllBoxes; }; 490 491 // toggles between displaying the bounding box of the node and 492 // the box of the contained scene nodes 493 inline void setShowNodes(bool show = true) { mShowNodes = show; }; 494 inline bool getShowNodes(void) { return mShowNodes; }; 493 495 494 496 NodePtr getRoot(void) const { return mKdRoot; }; … … 510 512 void setBuildMethod(BuildMethod bm) { mBuildMethod = bm; } 511 513 protected: 514 // init materials, logs and stuff 515 void init(); 512 516 // recursive insert funciton 513 517 void recInsert(KdTree::Node * node, KdRenderable * rend); … … 549 553 Stats mStats; 550 554 551 // show node or object aabb 552 bool mShowNodeAABB; 555 /** Visualization flags **/ 556 // show/highlight selected level in kdtree 557 int mHiLiteLevel; 558 // show whole kd-tree 559 bool mShowAllBoxes; 560 // show node or object boxes 561 bool mShowNodes; 553 562 554 563 -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreKdTreeSceneManager.h
r1187 r1192 243 243 // if bounding boxes of kdtree nodes are shown 244 244 bool mShowBoxes; 245 // bounding boxes of kd nodes will be highlighted on this level of the kd tree 246 int mHiLiteLevel; 247 // if all bounding boxes shall be displayed, not only the highlighted level 248 bool mShowAllBoxes; 249 // visualize kdtree nodes or bounding boxes of objects in nodes 250 bool mShowNodes; 245 251 246 252 // the method/algorithm used when rendering the scene … … 249 255 // the method of building the tree 250 256 KdTree::BuildMethod mBuildMethod; 251 #ifdef KDTREE_DEBUG252 // bounding boxes of kd nodes will be highlighted on this level of the kd tree253 int mHighlighLevel;254 // if all bounding boxes shall be displayed, not only the highlighted level255 bool mShowAllBoxes;256 #endif257 257 }; 258 258 -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTree.cpp
r1190 r1192 304 304 //---------------------------------------------------------------------------- 305 305 306 KdTree::KdTree(int maxdepth ):306 KdTree::KdTree(int maxdepth, BuildMethod bm): 307 307 mMaxDepth(maxdepth), 308 mBuildMethod(bm), 309 mHiLiteLevel(HILITE_OFF), 310 mShowAllBoxes(false), 311 mShowNodes(true), 308 312 mKdRoot(0), 309 mBuildMethod(KDBM_RECURSIVE), 310 mBuildLog(0), 311 mShowNodeAABB(true) 312 { 313 mBuildLog(0) 314 { 315 init(); 316 } 317 318 KdTree::KdTree(int maxdepth, BuildMethod bm, int hilite, bool allboxes, bool shownodes): 319 mMaxDepth(maxdepth), 320 mBuildMethod(bm), 321 mHiLiteLevel(hilite), 322 mShowAllBoxes(allboxes), 323 mShowNodes(shownodes), 324 mKdRoot(0), 325 mBuildLog(0) 326 { 327 init(); 328 } 329 330 KdTree::~KdTree() 331 { 332 delete mKdRoot; 333 } 334 335 void KdTree::init() 336 { 337 // init visualization materials 313 338 MaterialPtr mphi = MaterialManager::getSingleton().getByName("KdTree/BoxHiLite"); 314 339 if (mphi.isNull()) … … 318 343 mphi->setAmbient(green); 319 344 mphi->setDiffuse(green); 320 mphi->setSelfIllumination(ColourValue::Black);321 345 mphi->setLightingEnabled(true); 322 346 mphi->getTechnique(0)->getPass(0)->removeAllTextureUnitStates(); … … 330 354 mpviz->setAmbient(yellow); 331 355 mpviz->setDiffuse(yellow); 332 mpviz->setSelfIllumination(ColourValue::Black);333 356 mpviz->setLightingEnabled(true); 334 357 mpviz->getTechnique(0)->getPass(0)->removeAllTextureUnitStates(); 335 358 } 336 359 360 // retrieve or create build log 337 361 try 338 362 { … … 343 367 mBuildLog = LogManager::getSingleton().createLog(KDTREE_LOGNAME); 344 368 } 345 }346 347 KdTree::~KdTree()348 {349 delete mKdRoot;350 369 } 351 370 … … 399 418 else 400 419 { 401 KdTree::Branch * parent = node->mParent;420 KdTree::Branch * parent = KDBRANCHPTR_CAST(node->getParent()); 402 421 if (node == parent->mLeft) 403 422 { … … 571 590 else 572 591 { 573 KdTree::Branch * parent = KDBRANCHPTR_CAST(node-> mParent);592 KdTree::Branch * parent = KDBRANCHPTR_CAST(node->getParent()); 574 593 575 594 if (node == parent->mLeft) … … 738 757 if (parent) 739 758 { 740 level = parent-> mLevel+ 1;759 level = parent->getLevel() + 1; 741 760 } 742 761 … … 795 814 { 796 815 // Terminating condition reached, create leaf and add renderables to list 797 KdTree::Leaf * leaf = new KdTree::Leaf( level, aabb, parent);816 KdTree::Leaf * leaf = new KdTree::Leaf(this, level, aabb, parent); 798 817 KdRenderable *rend; 799 818 it = begin; … … 879 898 880 899 // create a new branch node and continue recursion 881 KdTree::Branch * branch = new KdTree::Branch(level, aabb, parent, best.event.getSplitPlane(), best.side); 900 KdTree::Branch * branch = new KdTree::Branch(this, level, aabb, parent, 901 best.event.getSplitPlane(), best.side); 882 902 883 903 // now create the child nodes and continue recursion … … 931 951 if (sc.parent) 932 952 { 933 level = sc.parent-> mLevel+ 1;953 level = sc.parent->getLevel() + 1; 934 954 } 935 955 … … 941 961 { 942 962 // Terminating condition reached, create leaf and add renderables to list 943 KdTree::Leaf * leaf = new KdTree::Leaf( level, sc.aabb, sc.parent);963 KdTree::Leaf * leaf = new KdTree::Leaf(this, level, sc.aabb, sc.parent); 944 964 KdRenderable *rend; 945 965 PlaneEventList::iterator begin = sc.events->begin(); … … 1032 1052 1033 1053 // create a new branch node 1034 KdTree::Branch * branch = 1035 new KdTree::Branch(level, sc.aabb, sc.parent,sc.best->event.getSplitPlane(), sc.best->side);1054 KdTree::Branch * branch = new KdTree::Branch(this, level, sc.aabb, sc.parent, 1055 sc.best->event.getSplitPlane(), sc.best->side); 1036 1056 1037 1057 globalTreeCost -= sc.decrease; … … 1174 1194 if (cam->isVisible(node->mAABB)) 1175 1195 { 1196 #if 0 1197 node->queueVisibleObjects(currentFrame, cam, queue, onlyShadowCasters, showBoxes); 1198 1199 if (node->getLeftChild()) 1200 recQueueVisibleObjects(node->getLeftChild(), currentFrame, cam, queue, onlyShadowCasters, showBoxes); 1201 if (node->getRightChild()) 1202 recQueueVisibleObjects(node->getRightChild(), currentFrame, cam, queue, onlyShadowCasters, showBoxes); 1203 #else 1176 1204 #ifdef KDTREE_DEBUG 1177 1205 WireBoundingBox * wbb = 0; 1178 1206 if (showBoxes) 1179 wbb = node->getWireBoundingBox( mShowNodeAABB);1207 wbb = node->getWireBoundingBox(); 1180 1208 #endif 1181 1209 … … 1198 1226 #else 1199 1227 if (showBoxes) 1200 queue->addRenderable(leaf->getWireBoundingBox( mShowNodeAABB));1228 queue->addRenderable(leaf->getWireBoundingBox()); 1201 1229 #endif 1202 1230 } … … 1209 1237 #else 1210 1238 if (showBoxes) 1211 queue->addRenderable(branch->getWireBoundingBox( mShowNodeAABB));1239 queue->addRenderable(branch->getWireBoundingBox()); 1212 1240 #endif 1213 1241 … … 1217 1245 recQueueVisibleObjects(branch->mRight, currentFrame, cam, queue, onlyShadowCasters, showBoxes); 1218 1246 } 1247 #endif 1219 1248 } 1220 1249 } … … 1241 1270 1242 1271 pad = ""; 1243 for (p = 0; p < node-> mLevel; p++)1272 for (p = 0; p < node->getLevel(); p++) 1244 1273 { 1245 1274 pad += " "; … … 1255 1284 scenenode = dynamic_cast<KdTreeSceneNode *>(*it); 1256 1285 log->logMessage(pad + "# Leaf level " + 1257 StringConverter::toString(node-> mLevel) +1286 StringConverter::toString(node->getLevel()) + 1258 1287 " SceneNode " + scenenode->getName()); 1259 1288 log->logMessage(pad + "## Objects: " + scenenode->dumpToString()); … … 1267 1296 { 1268 1297 log->logMessage(pad + "# Branch level " + 1269 StringConverter::toString(node-> mLevel) + " Left Child");1298 StringConverter::toString(node->getLevel()) + " Left Child"); 1270 1299 dump(branch->mLeft); 1271 1300 } … … 1273 1302 { 1274 1303 log->logMessage(pad + "# Branch level " + 1275 StringConverter::toString(node-> mLevel) + " Right Child");1304 StringConverter::toString(node->getLevel()) + " Right Child"); 1276 1305 dump(branch->mRight); 1277 1306 } … … 1342 1371 1343 1372 if (showBoxes) 1344 { 1345 WireBoundingBox * wbb = getWireBoundingBox(); 1346 if (wbb) 1347 queue->addRenderable(wbb); 1348 } 1373 if (mLevel == mOwner->getHiLiteLevel() || mOwner->getShowAllBoxes()) 1374 queue->addRenderable(getWireBoundingBox()); 1349 1375 } 1350 1376 -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTreeSceneManager.cpp
r1190 r1192 29 29 mMaxDepth(KDTREE_MAX_DEPTH), 30 30 mShowBoxes(false), 31 #ifdef KDTREE_DEBUG 32 mHighlighLevel(0), 31 mHiLiteLevel(0), 33 32 mShowAllBoxes(false), 34 #endif35 33 mBuildMethod(KdTree::KDBM_PRIORITYQUEUE), 36 34 mRenderMethod(KdTree::KDRM_INTERNAL), … … 102 100 { 103 101 mMaxDepth = maxdepth; 104 #ifdef KDTREE_DEBUG 105 if (mHighlighLevel > mMaxDepth) 106 mHighlighLevel = mMaxDepth; 107 #endif 102 if (mHiLiteLevel > mMaxDepth) 103 mHiLiteLevel = mMaxDepth; 108 104 return true; 109 105 } … … 139 135 { 140 136 OGRE_DELETE(mKdTree); 141 mKdTree = new KdTree(mMaxDepth); 142 mKdTree->setBuildMethod(mBuildMethod); 137 mKdTree = new KdTree(mMaxDepth, mBuildMethod, mHiLiteLevel, mShowAllBoxes, mShowNodes); 143 138 mKdTree->build(static_cast<KdTreeSceneNode *>(mSceneRoot)); 144 139 return true; 145 140 } 146 #ifdef KDTREE_DEBUG147 else if (strKey == "HighlightLevel")148 {149 int hl = *static_cast<const int *>(pValue);150 if (hl >= 0 && hl <= mMaxDepth)151 {152 mHighlighLevel = hl;153 return true;154 }155 else156 {157 return false;158 }159 }160 else if (strKey == "ShowAllBoxes")161 {162 bool sa = *static_cast<const bool *>(pValue);163 mShowAllBoxes = sa;164 return true;165 }166 #endif167 141 else if (strKey == "BuildMethod") 168 142 { … … 236 210 mRenderMethod = KdTree::KDRM_INTERNAL; 237 211 } 212 else 213 { 214 mRenderMethod = KdTree::KDRM_INTERNAL; 215 } 238 216 return success; 239 217 } … … 244 222 return true; 245 223 } 246 else if (strKey == "ShowNodeAABB") 224 else if (strKey == "HiLiteLevel") 225 { 226 int hl = *static_cast<const int *>(pValue); 227 if (hl >= 0 && hl <= mMaxDepth) 228 { 229 mHiLiteLevel = hl; 230 if (mKdTree) 231 mKdTree->setHiLiteLevel(mHiLiteLevel); 232 return true; 233 } 234 else 235 { 236 return false; 237 } 238 } 239 else if (strKey == "ShowAllBoxes") 240 { 241 bool sa = *static_cast<const bool *>(pValue); 242 mShowAllBoxes = sa; 243 if (mKdTree) 244 mKdTree->setShowAllBoxes(mShowAllBoxes); 245 return true; 246 } 247 else if (strKey == "ShowNodes") 247 248 { 248 249 bool sn = *static_cast<const bool *>(pValue); 250 mShowNodes = sn; 249 251 if (mKdTree) 250 mKdTree->setShowNode AABB(sn);252 mKdTree->setShowNodes(mShowNodes); 251 253 return true; 252 254 } … … 341 343 return true; 342 344 } 343 #ifdef KDTREE_DEBUG 344 else if (strKey == "HighlightLevel") 345 { 346 *static_cast<int *>(pDestValue) = mHighlighLevel; 345 else if (strKey == "BuildMethod") 346 { 347 if (mBuildMethod == KdTree::KDBM_PRIORITYQUEUE) 348 { 349 *static_cast<String *>(pDestValue) = "PriorityQueue"; 350 } 351 else if (mBuildMethod == KdTree::KDBM_RECURSIVE) 352 { 353 *static_cast<String *>(pDestValue) = "Recursive"; 354 } 355 return true; 356 } 357 else if (strKey == "RenderMethod") 358 { 359 if (mRenderMethod == KdTree::KDRM_INTERNAL) 360 { 361 *static_cast<String *>(pDestValue) = "INT"; 362 } 363 else if (mRenderMethod == KdTree::KDRM_GTP_VFC) 364 { 365 *static_cast<String *>(pDestValue) = "VFC"; 366 } 367 else if (mRenderMethod == KdTree::KDRM_GTP_SWC) 368 { 369 *static_cast<String *>(pDestValue) = "SWC"; 370 } 371 else if (mRenderMethod == KdTree::KDRM_GTP_CHC) 372 { 373 *static_cast<String *>(pDestValue) = "CHC"; 374 } 375 else 376 { 377 return false; 378 } 379 return true; 380 } 381 else if (strKey == "ShowKdTree") 382 { 383 *static_cast<bool *>(pDestValue) = mShowBoxes; 384 return true; 385 } 386 else if (strKey == "HiLiteLevel") 387 { 388 *static_cast<int *>(pDestValue) = mHiLiteLevel; 347 389 return true; 348 390 } 349 391 else if (strKey == "ShowAllBoxes") 350 392 { 351 if (mRenderMethod == KdTree::KDRM_INTERNAL) 352 *static_cast<bool *>(pDestValue) = mShowAllBoxes; 353 else 354 *static_cast<bool *>(pDestValue) = mVisualizeCulledNodes; 355 return true; 356 } 357 #endif 358 else if (strKey == "BuildMethod") 359 { 360 if (mBuildMethod == KdTree::KDBM_PRIORITYQUEUE) 361 { 362 *static_cast<String *>(pDestValue) = "PriorityQueue"; 363 } 364 else if (mBuildMethod == KdTree::KDBM_RECURSIVE) 365 { 366 *static_cast<String *>(pDestValue) = "Recursive"; 367 } 368 return true; 369 } 370 else if (strKey == "RenderMethod") 371 { 372 if (mRenderMethod == KdTree::KDRM_INTERNAL) 373 { 374 *static_cast<String *>(pDestValue) = "INT"; 375 } 376 else if (mRenderMethod == KdTree::KDRM_GTP_VFC) 377 { 378 *static_cast<String *>(pDestValue) = "VFC"; 379 } 380 else if (mRenderMethod == KdTree::KDRM_GTP_SWC) 381 { 382 *static_cast<String *>(pDestValue) = "SWC"; 383 } 384 else if (mRenderMethod == KdTree::KDRM_GTP_CHC) 385 { 386 *static_cast<String *>(pDestValue) = "CHC"; 387 } 388 else 389 { 390 return false; 391 } 392 return true; 393 } 394 else if (strKey == "ShowKdTree") 395 { 396 *static_cast<bool *>(pDestValue) = mShowBoxes; 397 return true; 398 } 399 else if (strKey == "ShowNodeAABB") 400 { 401 if (mKdTree) 402 *static_cast<bool *>(pDestValue) = mKdTree->getShowNodeAABB(); 403 else 404 *static_cast<bool *>(pDestValue) = false; 405 return true; 406 } 407 else if (strKey == "TreeBox") 408 { 409 if (mKdTree) 410 *static_cast<AxisAlignedBox *>(pDestValue) = mKdTree->getBox(); 411 else 412 *static_cast<AxisAlignedBox *>(pDestValue) = AxisAlignedBox(); 393 *static_cast<bool *>(pDestValue) = mShowAllBoxes; 394 return true; 395 } 396 else if (strKey == "ShowNodes") 397 { 398 *static_cast<bool *>(pDestValue) = mShowNodes; 399 return true; 413 400 } 414 401 … … 426 413 refKeys.push_back("RenderMethod"); 427 414 refKeys.push_back("ShowKdTree"); 428 refKeys.push_back("ShowNodeAABB"); 429 refKeys.push_back("TreeBox"); 430 #ifdef KDTREE_DEBUG 431 refKeys.push_back("HighlightLevel"); 415 refKeys.push_back("ShowNodes"); 416 refKeys.push_back("HiLiteLevel"); 432 417 refKeys.push_back("ShowAllBoxes"); 433 #endif434 418 return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface) 435 419 .getOptionKeys(refKeys); … … 515 499 if (!mKdTree) 516 500 { 517 mKdTree = new KdTree(mMaxDepth); 518 mKdTree->setBuildMethod(mBuildMethod); 501 mKdTree = new KdTree(mMaxDepth, mBuildMethod); 519 502 mKdTree->build(static_cast<KdTreeSceneNode *>(mSceneRoot)); 520 503 } … … 724 707 725 708 getRenderQueue()->clear(); // finally clear render queue 726 if ( 0) OGRE_DELETE(mRenderQueue); // HACK: should rather only be cleared ...709 if (1) OGRE_DELETE(mRenderQueue); // HACK: should rather only be cleared ... 727 710 728 711 if (0) WriteLog(); // write out stats
Note: See TracChangeset
for help on using the changeset viewer.