Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8741 in orxonox.OLD for branches/terrain/src/world_entities


Ignore:
Timestamp:
Jun 23, 2006, 11:29:40 AM (19 years ago)
Author:
ponder
Message:
  • Finally, I got the terrain working completly. What a hard work… It took me lots and lots of hours to remove all bugs in the tesselation routines.
Location:
branches/terrain/src/world_entities
Files:
2 edited

Legend:

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

    r8697 r8741  
    144144        mat->setAmbient( 1.0f, 1.0f, 1.0f );
    145145        mat->setDiffuseMap( _lightFile, GL_TEXTURE_2D, 0 );     
    146         mat->setDiffuseMap( std::string( "maps/gras_128.jpg" ), GL_TEXTURE_2D, 1 );     
     146        mat->setDiffuseMap( std::string( "pictures/debug.png" ), GL_TEXTURE_2D, 1 );   
    147147        terrain->addMaterial( mat );
    148148}
     
    382382  }
    383383}
     384void TerrainEntity::getAltitude( Vector& _position, Vector& _normal )
     385{
     386        Triple  altitude( _position.x-getAbsCoor().x, 0.0f, _position.z-getAbsCoor().z ),
     387                        normal( 0.0f, 0.0f, 0.0f );
     388        if ( terrain )
     389                        terrain->getAltitude( altitude, normal );
     390                       
     391        _position.y = altitude.y+getAbsCoor().y;
     392        _normal.z = normal.z; _normal.y = normal.y; _normal.z = normal.z;       
     393}
    384394
    385395float TerrainEntity::getHeight( float x, float z )
  • branches/terrain/src/world_entities/terrain_entity.h

    r8697 r8741  
    4545
    4646                float getHeight(float x, float y);
     47                void getAltitude( Vector& _position, Vector& _normal );
    4748                virtual void draw() const;
    4849
Note: See TracChangeset for help on using the changeset viewer.