Changeset 193 for trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/src/OgreTerrainRenderable.cpp
- Timestamp:
- 08/03/05 14:12:41 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/src/OgreTerrainRenderable.cpp
r159 r193 67 67 //----------------------------------------------------------------------- 68 68 TerrainRenderable::TerrainRenderable(const String& name) 69 : mTerrain(0), mName(name), mDeltaBuffers(0), mPositionBuffer(0)69 : Renderable(), mTerrain(0), mName(name), mDeltaBuffers(0), mPositionBuffer(0) 70 70 { 71 71 mForcedRenderLevel = -1; … … 220 220 *pSysPos++ = *pPos++ = ( float ) j * msOptions->scale.z; //z 221 221 222 *pTex0++ = ( float ) i / ( float ) msOptions->pageSize;223 *pTex0++ = ( float ) ( float ) j / ( float ) msOptions->pageSize;224 225 *pTex1++ = ( ( float ) i / ( float ) msOptions->tileSize) * msOptions->detailTile;226 *pTex1++ = ( ( float ) ( float ) j / ( float ) msOptions->tileSize) * msOptions->detailTile;222 *pTex0++ = ( float ) i / ( float ) ( msOptions->pageSize - 1 ); 223 *pTex0++ = ( float ) j / ( float ) ( msOptions->pageSize - 1 ); 224 225 *pTex1++ = ( ( float ) i / ( float ) ( msOptions->tileSize - 1 ) ) * msOptions->detailTile; 226 *pTex1++ = ( ( float ) j / ( float ) ( msOptions->tileSize - 1 ) ) * msOptions->detailTile; 227 227 228 228 if ( height < min ) … … 261 261 262 262 _calculateMinLevelDist2( C ); 263 if (msOptions->lit)264 _calculateNormals();265 263 266 264 } … … 301 299 void TerrainRenderable::_calculateNormals() 302 300 { 301 303 302 Vector3 norm; 304 303 … … 342 341 return ; 343 342 } 343 344 344 345 345 Vector3 cpos = cam -> getDerivedPosition(); … … 381 381 int nextLevel = mNextLevelDown[getRenderLevel()]; 382 382 #else 383 int nextLevel = mNextLevelDown ;383 int nextLevel = mNextLevelDown[mRenderLevel]; 384 384 #endif // GTP_VISIBILITY_MODIFIED_OGRE 385 385 … … 393 393 // Set the morph such that the morph happens in the last 0.25 of 394 394 // the distance range 395 Real range = mMinLevelDistSqr[nextLevel] - mMinLevelDistSqr[getRenderLevel()]; 395 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 396 Real range = mMinLevelDistSqr[nextLevel] - mMinLevelDistSqr[getRenderLevel()]; 397 #else 398 Real range = mMinLevelDistSqr[nextLevel] - mMinLevelDistSqr[mRenderLevel]; 399 #endif // GTP_VISIBILITY_MODIFIED_OGRE 396 400 if (range) 397 401 { 398 Real percent = (L - mMinLevelDistSqr[getRenderLevel()]) / range; 402 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 403 Real percent = (L - mMinLevelDistSqr[getRenderLevel()]) / range; 404 #else 405 Real percent = (L - mMinLevelDistSqr[mRenderLevel]) / range; 406 #endif // GTP_VISIBILITY_MODIFIED_OGRE 399 407 // scale result so that msLODMorphStart == 0, 1 == 1, clamp to 0 below that 400 408 Real rescale = 1.0f / (1.0f - msOptions->lodMorphStart); … … 430 438 431 439 } 440 432 441 } 433 442 //----------------------------------------------------------------------- … … 668 677 return ; 669 678 679 670 680 if ( mLevelIndex.size() == 0 ) 671 681 { 672 682 for ( int i = 0; i < 16; i++ ) 673 683 { 684 674 685 mLevelIndex.push_back( new IndexMap() ); 686 675 687 } 676 688 … … 695 707 void TerrainRenderable::_adjustRenderLevel( int i ) 696 708 { 709 697 710 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 698 711 mRenderLevel[msCurrentRenderLevelIndex] = i;
Note: See TracChangeset
for help on using the changeset viewer.