- Timestamp:
- Jun 21, 2006, 11:29:30 PM (18 years ago)
- Location:
- branches/terrain/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/terrain/src/lib/collision_detection/cd_engine.cc
r8684 r8690 87 87 tree->collideWith(*entity1, *entity2); 88 88 } 89 else { 90 this->checkCollisionGround( list1 ); 91 } 89 92 } 90 93 } 94 else { 95 this->checkCollisionGround( list2 ); 96 } 91 97 } 92 98 } … … 98 104 void CDEngine::checkCollisionGround(std::list<WorldEntity*>& list1) 99 105 { 100 if( likely( this->terrain != NULL ))106 if( likely( this->terrain != NULL ) ) 101 107 { 102 //kraus: TODO put collision detection for terrain class here...103 108 TerrainEntity *ground = dynamic_cast<TerrainEntity*>(this->terrain); 104 //Quadtree* q = dynamic_cast<TerrainEntity*>(this->terrain)->ssp->getQuadtree();105 //QuadtreeNode* n = q->getQuadtreeFromPosition(this->player->getAbsCoor());106 109 std::list<WorldEntity*>::iterator iterator; 107 PRINTF(3)("checking for collisions\n"); 108 110 PRINTF(2)("checking for collisions\n"); 109 111 iterator = list1.begin(); 110 112 while ( iterator != list1.end() ) { 111 113 const Vector& position = (*iterator)->getAbsCoor(); 112 113 float height = ground->getHeight( position.x, position.z ); 114 PRINTF(2)( "height: %f\n", height ); 114 float height = ground->getHeight( position.x, position.z ); 115 115 if ( position.y < height ) 116 116 (*iterator)->setAbsCoor( position.x, height, position.z ); -
branches/terrain/src/story_entities/game_world_data.cc
r8328 r8690 208 208 } 209 209 210 if( element->Value() == "Terrain " && created->isA(CL_TERRAIN))210 if( element->Value() == "TerrainEntity" && created->isA(CL_TERRAIN)) 211 211 { 212 212 this->terrain = dynamic_cast<TerrainEntity*>(created); -
branches/terrain/src/world_entities/terrain_entity.cc
r8684 r8690 177 177 this->getAbsCoor().y, 178 178 this->getAbsCoor().z ); 179 /* rotate */180 // Vector tmpRot = this->getAbsDir().getSpacialAxis();181 //glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );182 183 /*if (this->objectList)184 glCallList(this->objectList);185 else if (this->getModel())186 this->getModel()->draw();187 188 if (this->vegetation)189 this->vegetation->draw();190 */191 179 192 180 Vector cam = State::getCameraNode()->getAbsCoor(); … … 402 390 terrain->getAltitude( altitude, normal ); 403 391 404 return altitude.y ;405 } 392 return altitude.y+getAbsCoor().y; 393 }
Note: See TracChangeset
for help on using the changeset viewer.