- Timestamp:
- 07/04/05 17:57:51 (19 years ago)
- Location:
- trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/src/OgreOctree.cpp
r139 r154 88 88 mHalfSize( 0, 0, 0 ) 89 89 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 90 , mLastVisited(0), mVisible(false), mLastRendered(-1) 90 , mLastVisited(0), mVisible(false), mLastRendered(-1), mId(-1) 91 91 #endif //GTP_VISIBILITY_MODIFIED_OGRE 92 92 { … … 271 271 } 272 272 } 273 //----------------------------------------------------------------------- 274 void Octree::setId(int id) 275 { 276 mId = id; 277 } 278 //----------------------------------------------------------------------- 279 int Octree::getId() 280 { 281 return mId; 282 } 273 283 #endif //GTP_VISIBILITY_MODIFIED_OGRE 274 284 } -
trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/src/OgreOctreeSceneManager.cpp
r139 r154 318 318 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 319 319 mNumOctreeNodes = 1; 320 mOctree->setId(mNumOctreeNodes); 320 321 #endif // GTP_VISIBILITY_MODIFIED_OGRE 321 322 mMaxDepth = depth; … … 468 469 octant -> mChildren[ x ][ y ][ z ] = new Octree( octant ); 469 470 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 470 m NumOctreeNodes ++;471 mOctree->setId(++ mNumOctreeNodes); 471 472 #endif // GTP_VISIBILITY_MODIFIED_OGRE 472 473 … … 1032 1033 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 1033 1034 mNumOctreeNodes = 1; 1035 mOctree->setId(mNumOctreeNodes); 1034 1036 #endif // GTP_VISIBILITY_MODIFIED_OGRE 1035 1037 mOctree->mBox = box; -
trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/src/OgreTerrainRenderable.cpp
r139 r154 58 58 bool TerrainRenderable::mLevelInit = false; 59 59 const TerrainOptions* TerrainRenderable::msOptions = 0; 60 61 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 60 62 int TerrainRenderable::msCurrentRenderLevelIndex = 0; 63 #endif // GTP_VISIBILITY_MODIFIED_OGRE 61 64 //----------------------------------------------------------------------- 62 65 //----------------------------------------------------------------------- … … 177 180 mInit = true; 178 181 179 //#ifdef GTP_VISIBILITY_MODIFIED_OGRE 180 // for up to 10 passes 181 for (int i = 0; i < 10; ++i) 182 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 183 for (int i = 0; i < MAX_RENDERLEVEL_INDEX; ++i) 182 184 { 183 185 mRenderLevel[i] = 1; 184 186 } 187 #else 188 mRenderLevel = 1; 189 #endif // GTP_VISIBILITY_MODIFIED_OGRE 185 190 186 191 mMinLevelDistSqr = new Real[ msOptions->maxGeoMipMapLevel ]; … … 330 335 if ( mForcedRenderLevel >= 0 ) 331 336 { 337 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 332 338 mRenderLevel[msCurrentRenderLevelIndex] = mForcedRenderLevel; 339 #else 340 mRenderLevel = mForcedRenderLevel; 341 #endif // GTP_VISIBILITY_MODIFIED_OGRE 333 342 return ; 334 343 } … … 339 348 Real L = diff.squaredLength(); 340 349 341 mRenderLevel[msCurrentRenderLevelIndex] = -1; 350 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 351 mRenderLevel[msCurrentRenderLevelIndex] = -1;; 352 #else 353 mRenderLevel = -1; 354 #endif // GTP_VISIBILITY_MODIFIED_OGRE 342 355 343 356 for ( int i = 0; i < msOptions->maxGeoMipMapLevel; i++ ) … … 345 358 if ( mMinLevelDistSqr[ i ] > L ) 346 359 { 360 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 347 361 mRenderLevel[msCurrentRenderLevelIndex] = i - 1; 362 #else 363 mRenderLevel = i - 1; 364 #endif // GTP_VISIBILITY_MODIFIED_OGRE 348 365 break; 349 366 } 350 367 } 351 368 369 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 352 370 if ( getRenderLevel() < 0 ) 353 371 mRenderLevel[msCurrentRenderLevelIndex] = msOptions->maxGeoMipMapLevel - 1; 372 #else 373 if ( mRenderLevel < 0 ) 374 mRenderLevel = msOptions->maxGeoMipMapLevel - 1; 375 #endif // GTP_VISIBILITY_MODIFIED_OGRE 354 376 355 377 if (msOptions->lodMorph) 356 378 { 357 379 // Get the next LOD level down 380 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 358 381 int nextLevel = mNextLevelDown[getRenderLevel()]; 382 #else 383 int nextLevel = mNextLevelDown; 384 #endif // GTP_VISIBILITY_MODIFIED_OGRE 385 359 386 if (nextLevel == 0) 360 387 { … … 668 695 void TerrainRenderable::_adjustRenderLevel( int i ) 669 696 { 670 697 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 671 698 mRenderLevel[msCurrentRenderLevelIndex] = i; 699 #else 700 mRenderLevel = i; 701 #endif // GTP_VISIBILITY_MODIFIED_OGRE 672 702 } 673 703 //----------------------------------------------------------------------- … … 1469 1499 1470 1500 } 1471 1501 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 1502 //----------------------------------------------------------------------- 1503 int TerrainRenderable::getCurrentRenderLevelIndex() 1504 { 1505 return msCurrentRenderLevelIndex; 1506 } 1507 //----------------------------------------------------------------------- 1508 void TerrainRenderable::setCurrentRenderLevelIndex(int index) 1509 { 1510 if (index > MAX_RENDERLEVEL_INDEX) 1511 index = 0; 1512 1513 msCurrentRenderLevelIndex = index; 1514 } 1515 #endif // GTP_VISIBILITY_MODIFIED_OGRE 1472 1516 1473 1517 } //namespace
Note: See TracChangeset
for help on using the changeset viewer.