Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 21, 2006, 6:23:57 PM (18 years ago)
Author:
ponder
Message:

Tried to do the collision detection for the terrain.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/terrain/src/world_entities/terrain_entity.cc

    r8595 r8684  
    174174
    175175  /* 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 );
    179179  /* rotate */
    180180  // Vector tmpRot = this->getAbsDir().getSpacialAxis();
     
    397397float TerrainEntity::getHeight( float x, float z )
    398398{
    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 );
    400401        if ( terrain )
    401402                terrain->getAltitude( altitude, normal );
Note: See TracChangeset for help on using the changeset viewer.