Changeset 1183 for GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include
- Timestamp:
- 08/04/06 17:38:52 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreKdTree.h
r1182 r1183 211 211 //virtual void cbInsert(KdTree * caller, KdRenderable * rend) = 0; 212 212 213 WireBoundingBox * getWireBoundingBox( )213 WireBoundingBox * getWireBoundingBox(bool node = true) 214 214 { 215 215 if (mWBB == 0) 216 216 mWBB = new WireBoundingBox(); 217 217 218 mWBB->setupBoundingBox(mAABB); 218 if (node) 219 mWBB->setupBoundingBox(mAABB); 220 else 221 mWBB->setupBoundingBox(mWorldAABB); 219 222 220 223 #ifdef KDTREE_DEBUG 224 SceneManager * sceneManager = Root::getSingleton()._getCurrentSceneManager(); 221 225 int level = -1; 222 226 bool boxes = false; 223 if ( Root::getSingleton()._getCurrentSceneManager()->getOption("HighlightLevel",&level))227 if (sceneManager->getOption("HighlightLevel",&level)) 224 228 { 225 229 if (mLevel == level) … … 232 236 { 233 237 mWBB->setMaterial("BaseWhiteNoLighting"); 234 if ( Root::getSingleton()._getCurrentSceneManager()->getOption("ShowAllBoxes", &boxes))238 if (sceneManager->getOption("ShowAllBoxes", &boxes)) 235 239 { 236 240 if (boxes) … … 279 283 /** Updates bound of the real aabb of kdtree 280 284 */ 281 virtual void _updateBounds() = 0; 282 285 virtual void _updateBounds(bool recurse = true) = 0; 283 286 284 287 Branch * mParent; … … 325 328 326 329 // branches do not posses geometry => just merge child aabbs 327 virtual void _updateBounds( )330 virtual void _updateBounds(bool recurse = true) 328 331 { 329 332 // reset box … … 336 339 337 340 // update parent recursively 338 if ( mParent)339 mParent->_updateBounds( );341 if (recurse && mParent) 342 mParent->_updateBounds(recurse); 340 343 } 341 344 … … 365 368 366 369 // update the world aabb based on the contained geometry 367 virtual void _updateBounds( );370 virtual void _updateBounds(bool recurse = true); 368 371 369 372 virtual void remove(KdRenderable * rend) … … 464 467 void dump(void); 465 468 Real calcCost(void); 469 470 /** Switches between displaying the bounding box of the node and 471 the box of the contained scene nodes 472 */ 473 inline void setShowNodeAABB(bool show = true) { mShowNodeAABB = show; }; 474 inline bool getShowNodeAABB(void) { return mShowNodeAABB; }; 466 475 467 476 NodePtr getRoot(void) const { return mKdRoot; }; … … 523 532 Stats mStats; 524 533 534 // show node or object aabb 535 bool mShowNodeAABB; 536 537 525 538 // DEBUG 526 539 void KdTree::dump(KdTree::Node * node);
Note: See TracChangeset
for help on using the changeset viewer.