Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8747 in orxonox.OLD for branches/terrain/src/lib/graphics


Ignore:
Timestamp:
Jun 23, 2006, 4:45:04 PM (18 years ago)
Author:
ponder
Message:

Added a boundary check to the getAltitude() method

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/terrain/src/lib/graphics/importer/terrain/terrain.h

    r8745 r8747  
    206206inline float Terrain::getAltitude( int _x, int _z ) const
    207207{
     208        if ( _x < 0 || _x > heightfield.width || _z < 0 || _z > heightfield.height )
     209                return 0.0f;
    208210        return heightfield.data[heightfield.pitch*_z+_x]/255.0f;       
    209211}
Note: See TracChangeset for help on using the changeset viewer.