- Timestamp:
- Jun 20, 2006, 8:44:18 PM (18 years ago)
- Location:
- branches/terrain/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/terrain/src/lib/graphics/importer/terrain/terrain.cc
r8642 r8648 51 51 x > 0 ? getPage( x-1, z+0 ) : NULL, 52 52 x < pagesX-1 ? getPage( x+1, z+0 ) : NULL, 53 z > 0 ? getPage( x+0, z-1 ) : NULL,54 z < pagesZ-1 ? getPage( x+0, z+1 ) : NULL );53 z < pagesZ-1 ? getPage( x+0, z+1 ) : NULL, 54 z > 0 ? getPage( x+0, z-1 ) : NULL ); 55 55 56 56 printf( "looks good\n" ); … … 69 69 node->setChildren( NULL, NULL, NULL, NULL ); 70 70 } 71 else { 72 assert( ( _x0 % 2 ) == 0 ); 73 assert( ( _x1 % 2 ) == 0 ); 74 assert( ( _z0 % 2 ) == 0 ); 75 assert( ( _z1 % 2 ) == 0 ); 71 else { 76 72 node = new TerrainQuad( this, _x0, _z0, _x1, _z1 ); 77 73 node->setChildren( … … 200 196 broker->acquire( bi.vbIdentifier, bi.ibIdentifier ); 201 197 buffers.push_back( bi ); 198 int dirtyRounds = 0; 202 199 do { 200 dirtyRounds++; 203 201 dirty = false; 204 202 page = activePages; … … 211 209 } 212 210 wantedLeft = wantedRight = wantedBottom = wantedTop = page->getWantedLOD(); 213 if ( ( neighbor = page->getLeft() ) )211 if ( ( neighbor = page->getLeft() ) && ( neighbor->isActive() ) ) 214 212 wantedLeft = neighbor->getWantedLOD(); 215 if ( ( neighbor = page->getRight() ) )213 if ( ( neighbor = page->getRight() ) && ( neighbor->isActive() ) ) 216 214 wantedRight = neighbor->getWantedLOD(); 217 if ( ( neighbor = page->getTop() ) )215 if ( ( neighbor = page->getTop() ) && ( neighbor->isActive() ) ) 218 216 wantedTop = neighbor->getWantedLOD(); 219 if ( ( neighbor = page->getBottom() ) )217 if ( ( neighbor = page->getBottom() ) && ( neighbor->isActive() ) ) 220 218 wantedBottom = neighbor->getWantedLOD(); 221 219 … … 224 222 if ( minLOD < page->getWantedLOD()-1 ) { 225 223 page->setWantedLOD( minLOD+1 ); 226 //dirty = true;224 dirty = true; 227 225 } 228 226 page = page->getNext(); 229 227 } 230 228 } while ( dirty ); 229 printf( "dirtyrounds: %d\n", dirtyRounds ); 231 230 page = activePages; 232 231 … … 247 246 indices, GL_DYNAMIC_DRAW_ARB ); 248 247 } 249 s = 500.0f; 248 s = 200.0f; 249 glPushAttrib( GL_COLOR_BUFFER_BIT ); 250 250 for ( unsigned int i = 0; i < materials.size(); ++i ) { 251 251 page = activePages; … … 308 308 glDisableClientState( GL_TEXTURE_COORD_ARRAY ); 309 309 glEnable( GL_LIGHTING ); 310 glMatrixMode( GL_TEXTURE ); 311 glLoadIdentity(); 312 glPopAttrib(); 310 313 } 311 314 -
branches/terrain/src/lib/graphics/importer/terrain/terrain_page.cc
r8641 r8648 98 98 _adapt[TP_RIGHT] = ( wantedLOD - right->getWantedLOD() ) > 0; 99 99 100 if ( top && top->isVisible )100 if ( top && top->isVisible ) 101 101 _adapt[TP_TOP] = ( wantedLOD - top->getWantedLOD() ) > 0; 102 102 … … 128 128 wantedLOD = TerrainPage::MAX_LODS-1; 129 129 } 130 // Calculate the tween factor. The calculation is different if LOD is 0131 //132 if ( wantedLOD > 0 ) {133 134 }135 else {136 137 }138 130 return wantedLOD; 139 131 } … … 244 236 { 245 237 246 bool leftChanged = ( left && left->isVisible ) && ( left->wantedLOD != left->currentLOD ), 247 rightChanged = ( right && right->isVisible ) && ( right->wantedLOD != right->currentLOD ), 248 topChanged = ( top && top->isVisible ) && ( top->wantedLOD != currentLOD ), 249 bottomChanged = ( bottom && bottom->isVisible ) && ( bottom->wantedLOD != bottom->currentLOD ), 238 bool leftChanged = ( left && left->isActive() ) && 239 ( left->wantedLOD != left->currentLOD ), 240 rightChanged = ( right && right->isActive() ) && 241 ( right->wantedLOD != right->currentLOD ), 242 topChanged = ( top && top->isActive() ) && 243 ( top->wantedLOD != currentLOD ), 244 bottomChanged = ( bottom && bottom->isActive() ) && 245 ( bottom->wantedLOD != bottom->currentLOD ), 250 246 iChanged = wantedLOD != currentLOD; 251 247 … … 518 514 int zStart = 0, zEnd = owner->getPageSize()-stride; 519 515 520 if ( adapt[TP_ TOP] ) {516 if ( adapt[TP_BOTTOM] ) { 521 517 tesselateRow( 0, stride / 2, stride, adapt[TP_LEFT], adapt[TP_RIGHT] ); 522 518 zStart+= stride; 523 519 } 524 520 525 if ( adapt[TP_ BOTTOM] )521 if ( adapt[TP_TOP] ) 526 522 zEnd-= stride; 527 523 … … 530 526 531 527 532 if ( adapt[TP_BOTTOM] ) { 533 534 addAgain( ); 535 addIndex( getIndex( 0, owner->getPageSize()-1-stride ) ); 536 537 tesselateRow( owner->getPageSize()-1-stride, stride / 2, stride, adapt[TP_LEFT], adapt[TP_RIGHT] ); 528 if ( adapt[TP_TOP] ) { 529 addAgain( ); 530 addIndex( getIndex( 0, owner->getPageSize()-1-stride ) ); 531 tesselateRow( owner->getPageSize()-1-stride, stride / 2, 532 stride, adapt[TP_LEFT], adapt[TP_RIGHT] ); 538 533 } 539 534 -
branches/terrain/src/lib/graphics/importer/terrain/terrain_page.h
r8641 r8648 210 210 return true; 211 211 } 212 213 212 inline void setWantedLOD( int _lod ) 214 213 { -
branches/terrain/src/world_entities/camera.cc
r8548 r8648 36 36 this->setFovy(60.0); 37 37 this->setAspectRatio(1.2f); 38 this->setClipRegion( .1, 80.0f );38 this->setClipRegion( .1, 40.0f ); 39 39 40 40 this->setViewMode(Camera::ViewNormal); … … 83 83 { 84 84 this->nearClip = nearClip; 85 this->farClip = farClip;85 this->farClip = 400.0f;//farClip; 86 86 } 87 87 -
branches/terrain/src/world_entities/skybox.cc
r8037 r8648 230 230 // glPushAttrib(GL_LIGHTING_BIT); 231 231 glDisable(GL_LIGHTING); 232 232 glDisable( GL_DEPTH_TEST ); 233 233 glDisable(GL_FOG); 234 234
Note: See TracChangeset
for help on using the changeset viewer.