Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8690 in orxonox.OLD for branches


Ignore:
Timestamp:
Jun 21, 2006, 11:29:30 PM (18 years ago)
Author:
ponder
Message:
 
Location:
branches/terrain/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/terrain/src/lib/collision_detection/cd_engine.cc

    r8684 r8690  
    8787            tree->collideWith(*entity1, *entity2);
    8888        }
     89                else {
     90                        this->checkCollisionGround( list1 );
     91                }
    8992      }
    9093    }
     94        else {
     95                this->checkCollisionGround( list2 );
     96        }
    9197  }
    9298}
     
    98104void CDEngine::checkCollisionGround(std::list<WorldEntity*>& list1)
    99105{
    100   if( likely( this->terrain != NULL))
     106  if( likely( this->terrain != NULL ) )
    101107  {
    102         //kraus: TODO put collision detection for terrain class here...
    103108        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());
    106109    std::list<WorldEntity*>::iterator iterator;
    107     PRINTF(3)("checking for collisions\n");
    108 
     110    PRINTF(2)("checking for collisions\n");
    109111    iterator = list1.begin();
    110112    while ( iterator != list1.end() ) {
    111113                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 );             
    115115                if ( position.y < height )
    116116                        (*iterator)->setAbsCoor( position.x, height, position.z );
  • branches/terrain/src/story_entities/game_world_data.cc

    r8328 r8690  
    208208      }
    209209               
    210       if( element->Value() == "Terrain" && created->isA(CL_TERRAIN))
     210      if( element->Value() == "TerrainEntity" && created->isA(CL_TERRAIN))
    211211      {
    212212        this->terrain = dynamic_cast<TerrainEntity*>(created);
  • branches/terrain/src/world_entities/terrain_entity.cc

    r8684 r8690  
    177177                 this->getAbsCoor().y,
    178178                 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 */
    191179
    192180        Vector cam = State::getCameraNode()->getAbsCoor();
     
    402390                terrain->getAltitude( altitude, normal );
    403391               
    404   return altitude.y;
    405 }
     392  return altitude.y+getAbsCoor().y;
     393}
Note: See TracChangeset for help on using the changeset viewer.