- Timestamp:
- Jun 21, 2006, 6:23:57 PM (18 years ago)
- Location:
- branches/terrain/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/terrain/src/lib/collision_detection/cd_engine.cc
r8328 r8684 101 101 { 102 102 //kraus: TODO put collision detection for terrain class here... 103 TerrainEntity *ground = dynamic_cast<TerrainEntity*>(this->terrain); 103 104 //Quadtree* q = dynamic_cast<TerrainEntity*>(this->terrain)->ssp->getQuadtree(); 104 //QuadtreeNode* n = q->getQuadtreeFromPosition(this->player->getAbsCoor()); 105 //QuadtreeNode* n = q->getQuadtreeFromPosition(this->player->getAbsCoor()); 106 std::list<WorldEntity*>::iterator iterator; 107 PRINTF(3)("checking for collisions\n"); 108 109 iterator = list1.begin(); 110 while ( iterator != list1.end() ) { 111 const Vector& position = (*iterator)->getAbsCoor(); 112 113 float height = ground->getHeight( position.x, position.z ); 114 PRINTF(2)( "height: %f\n", height ); 115 if ( position.y < height ) 116 (*iterator)->setAbsCoor( position.x, height, position.z ); 117 } 105 118 } 106 119 -
branches/terrain/src/lib/graphics/importer/terrain/terrain.cc
r8648 r8684 227 227 } 228 228 } while ( dirty ); 229 printf( "dirtyrounds: %d\n", dirtyRounds );229 230 230 page = activePages; 231 232 231 while ( page ) { 233 232 page->updateTesselation(); … … 286 285 } 287 286 activatedCount = 0; deactivatedCount = 0; 288 //printf( "%d of %d pages drawn\n", pagesX*pagesZ-cullCount, pagesX*pagesZ );289 //float percentage = (float)cullCount/(float)(pagesX*pagesZ)*100.0f;290 //printf( "culled %f%% terrain pages away\n", percentage );291 287 } 292 288 -
branches/terrain/src/lib/graphics/importer/terrain/terrain.h
r8642 r8684 233 233 std::vector<BufferInfo> buffers; 234 234 235 //Texture *tex;236 235 Triple cameraPosition; 237 236 pFrustum frustum; -
branches/terrain/src/lib/graphics/importer/terrain/terrain_page.cc
r8648 r8684 338 338 addIndex( getIndex( halfStride, 0 ) ); 339 339 addIndex( getIndex( stride, 0 ) ); 340 addAgain( 340 addAgain( ); 341 341 addIndex( getIndex( 0, stride ) ); 342 342 addIndex( getIndex( stride, halfStride ) ); … … 352 352 addIndex( getIndex( halfStride, 0 ) ); 353 353 addIndex( getIndex( 0, 0 ) ); 354 addAgain( 354 addAgain( ); 355 355 break; 356 356 357 357 case ADAPT_T: 358 358 addIndex( getIndex( stride, stride ) ); 359 addAgain( 359 addAgain( ); 360 360 addIndex( getIndex( halfStride, stride ) ); 361 361 addIndex( getIndex( stride, 0 ) ); … … 369 369 addIndex( getIndex( halfStride, stride ) ); 370 370 addIndex( getIndex( 0, stride ) ); 371 addAgain( 371 addAgain( ); 372 372 addIndex( getIndex( stride, 0 ) ); 373 373 addIndex( getIndex( 0, halfStride ) ); … … 392 392 addIndex( getIndex( halfStride, stride ) ); 393 393 addIndex( getIndex( stride, stride ) ); 394 addAgain( 394 addAgain( ); 395 395 break; 396 396 397 397 case ADAPT_BT: 398 398 addIndex( getIndex( 0, 0 ) ); 399 addAgain( 400 addIndex( getIndex( halfStride, 0 ) ); 401 addIndex( getIndex( 0, stride ) ); 402 addIndex( getIndex( stride, 0 ) ); 403 addIndex( getIndex( halfStride, stride ) ); 404 addIndex( getIndex( stride, stride ) ); 405 addAgain( 399 addAgain( ); 400 addIndex( getIndex( halfStride, 0 ) ); 401 addIndex( getIndex( 0, stride ) ); 402 addIndex( getIndex( stride, 0 ) ); 403 addIndex( getIndex( halfStride, stride ) ); 404 addIndex( getIndex( stride, stride ) ); 405 addAgain( ); 406 406 break; 407 407 … … 414 414 addIndex( getIndex( halfStride, stride ) ); 415 415 addIndex( getIndex( stride, stride ) ); 416 addAgain( 416 addAgain( ); 417 417 break; 418 418 … … 425 425 addIndex( getIndex( halfStride, 0 ) ); 426 426 addIndex( getIndex( 0, 0 ) ); 427 addAgain( 427 addAgain( ); 428 428 break; 429 429 … … 439 439 break; 440 440 } 441 assert( numVertices > 3 );442 443 441 assert( numIndices % 2 == 0 ); 444 442 } -
branches/terrain/src/lib/graphics/importer/terrain/terrain_page.h
r8648 r8684 225 225 * @brief Tesselates one row of the terrain page. 226 226 * @param _z The z-offset of the row 227 * @param _xStride Determines the step-size horizontally 228 * @param _zStride Determines the step-size vertically. 227 * @param _xStride Defines the step-size horizontally 228 * @param _zStride Defines the step-size vertically. 229 * @param _adaptLeft True if the left neighbor has a coarser 230 * tesselation level. 229 231 * @param _adaptRight True if the right neighbor has a coarser 230 232 * tesselation level. 231 * @param _adaptLeft True if the left neighbor has a coarser232 * tesselation level.233 233 */ 234 234 void tesselateRow( int _z, int _xStride, int _zStride, bool _adaptLeft, bool _adaptRight ); -
branches/terrain/src/world_entities/terrain_entity.cc
r8595 r8684 174 174 175 175 /* translate */ 176 /* glTranslatef (this->getAbsCoor().x,177 this->getAbsCoor().y,178 this->getAbsCoor ().z );*/176 glTranslatef( this->getAbsCoor().x, 177 this->getAbsCoor().y, 178 this->getAbsCoor().z ); 179 179 /* rotate */ 180 180 // Vector tmpRot = this->getAbsDir().getSpacialAxis(); … … 397 397 float TerrainEntity::getHeight( float x, float z ) 398 398 { 399 Triple altitude( x, 0.0f, z ), normal( 0.0f, 0.0f, 0.0f ); 399 Triple altitude( x-getAbsCoor().x, 0.0f, z-getAbsCoor().z ), 400 normal( 0.0f, 0.0f, 0.0f ); 400 401 if ( terrain ) 401 402 terrain->getAltitude( altitude, normal );
Note: See TracChangeset
for help on using the changeset viewer.