Changeset 154 for trunk/VUT/work/ogre_changes
- Timestamp:
- 07/04/05 17:57:51 (20 years ago)
- Location:
- trunk/VUT/work/ogre_changes
- Files:
-
- 3 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/work/ogre_changes/OgreMain/include/OgreSceneNode.h
r61 r154 444 444 void setLastRendered(int frameid); 445 445 446 /** Sets scene node id 447 @param the id 448 */ 449 void setId(int id); 450 /** see set */ 451 int getId(void); 452 446 453 protected: 447 454 int mLastVisited; 448 455 bool mVisible; 449 456 int mLastRendered; 450 457 int mId; 451 458 #endif //GTP_VISIBILITY_MODIFIED_OGRE 452 459 -
trunk/VUT/work/ogre_changes/OgreMain/src/OgreSceneNode.cpp
r61 r154 42 42 mYawFixed(false), mAutoTrackTarget(0), mIsInSceneGraph(false) 43 43 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 44 , mLastVisited(0), mVisible(false), mLastRendered(-1) 44 , mLastVisited(0), mVisible(false), mLastRendered(-1), mId(-1) 45 45 #endif //GTP_VISIBILITY_MODIFIED_OGRE 46 46 { … … 53 53 mAutoTrackTarget(0), mIsInSceneGraph(false) 54 54 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 55 , mLastVisited(0), mVisible(false) 55 , mLastVisited(0), mVisible(false), mId(-1) 56 56 #endif //GTP_VISIBILITY_MODIFIED_OGRE 57 57 { … … 641 641 mLastRendered = frameid; 642 642 } 643 //----------------------------------------------------------------------- 644 void SceneNode::setId(int id) 645 { 646 mId = id; 647 } 648 //----------------------------------------------------------------------- 649 int SceneNode::getId(void) 650 { 651 return mId; 652 } 643 653 #endif //GTP_VISIBILITY_MODIFIED_OGRE 644 654 } -
trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/include/OgreOctree.h
r135 r154 192 192 void _updateBounds(); 193 193 194 /** Sets scene node id 195 @param the id 196 */ 197 void setId(int id); 198 199 /** see set */ 200 int getId(void); 201 194 202 protected: 195 203 … … 201 209 bool mVisible; 202 210 int mDepth; 211 int mId; 203 212 204 213 #endif // GTP_VISIBILITY_MODIFIED_OGRE -
trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/include/OgreTerrainRenderable.h
r131 r154 47 47 48 48 #define MORPH_CUSTOM_PARAM_ID 77 49 50 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 51 #define MAX_RENDERLEVEL_INDEX 15 52 #endif // GTP_VISIBILITY_MODIFIED_OGRE 49 53 50 54 namespace Ogre … … 293 297 /// Get the static list of indexes cached (internal use only) 294 298 static TerrainBufferCache& _getIndexCache(void) {return msIndexCache;} 295 // index of renderlevel of current pass 296 static int getCurrentRenderLevelIndex() {return msCurrentRenderLevelIndex;} 297 static void setCurrentRenderLevelIndex(int index) {msCurrentRenderLevelIndex = index;} 299 300 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 301 // index of renderlevel used for current pass 302 static int getCurrentRenderLevelIndex(); 303 // returns index of renderlevel 304 static void setCurrentRenderLevelIndex(int index); 305 #endif // GTP_VISIBILITY_MODIFIED_OGRE 306 298 307 protected: 299 308 // index of renderlevel of current pass … … 355 364 VertexData* mTerrain; 356 365 357 /// The current LOD level: for multiple passes, up to 10 renderlevels can be saved 358 int mRenderLevel[10]; 366 /// The current LOD level 367 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 368 int mRenderLevel[MAX_RENDERLEVEL_INDEX]; 369 #else 370 int mRenderLevel; 371 #endif // GTP_VISIBILITY_MODIFIED_OGRE 372 359 373 /// The previous 'next' LOD level down, for frame coherency 360 374 int mLastNextLevel; -
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 -
trunk/VUT/work/ogre_changes/RenderSystems/Direct3D9/include/OgreD3D9Texture.h
r153 r154 311 311 312 312 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 313 uchar *getBufferContents(int &dimx, int &dimy) { return NULL; };313 uchar *getBufferContents(int &dimx, int &dimy) { dimx = dimy = 0; return NULL; }; 314 314 #endif // GTP_VISIBILITY_MODIFIED_OGRE 315 315
Note: See TracChangeset
for help on using the changeset viewer.