ES3D::Terrainf Class Reference

#include <Terrainf.h>

List of all members.

Public Member Functions

 Terrainf ()
virtual ~Terrainf ()
ES3Denum loadHeightMapf (const char *const filename, GLfloat xzstep, GLfloat ystep)
ES3Denum loadTextureMapf (const char *const filename)
ES3Denum prepareGeneratedTextureMapf (GLuint width, GLuint numberTiles)
ES3Denum addTilef (const char *const filename, GLubyte hundredPercentAt)
ES3Denum generateTextureMapf (GLuint repeat)
ES3Denum enableLightf (ES3Denum mode)
ES3Denum loadDetailTexturef (const char *const filename, GLuint repeat)
GLvoid updatef (GLuint time)
GLvoid renderf (GLvoid) const
GLvoid resetf (GLvoid)
ES3Denum getHeightAtf (GLfloat wx, GLfloat wz, GLfloat &wy)
GLvoid enableROAMf (GLuint minDetail, GLuint maxDetail)
GLvoid updateROAMf (const GLfloat pivot[3], const GLfloat direction[3], const GLfloat angle, const GLint delta, const GLfloat distance, const GLfloat tolerance)
GLvoid disableROAMf (GLvoid)

Public Attributes

GLfloat position [3]

Static Public Attributes

static GLfloat ambientFactor = 0.05f


Detailed Description

Terrain class


Constructor & Destructor Documentation

ES3D::Terrainf::Terrainf (  ) 

Constructor

ES3D::Terrainf::~Terrainf (  )  [virtual]

Destructor


Member Function Documentation

ES3Denum ES3D::Terrainf::addTilef ( const char *const   filename,
GLubyte  hundredPercentAt 
)

Adds a tile for generating the texture map. Tiles should be added from the lowest to the highest tile.

Parameters:
filename the filename of the tile
hundredPercentAt the value where the tiel does have hundred percent
Returns:
errocode

GLvoid ES3D::Terrainf::disableROAMf ( GLvoid   ) 

Disables ROAM for this terrain

ES3Denum ES3D::Terrainf::enableLightf ( ES3Denum  mode  ) 

Enables / disables light for the terrain

Parameters:
mode mode, if light should be turned of or not
Returns:
errorcode

GLvoid ES3D::Terrainf::enableROAMf ( GLuint  minDetail,
GLuint  maxDetail 
)

Enables ROAM for this terrain

Parameters:
minDetail minimum detail
maxDetail maximum detail

ES3Denum ES3D::Terrainf::generateTextureMapf ( GLuint  repeat  ) 

Generates a texture map out of the given tiles

Parameters:
repeat the times how often a tile is repeated on the map
Returns:
errorcode

ES3Denum ES3D::Terrainf::getHeightAtf ( GLfloat  wx,
GLfloat  wz,
GLfloat &  wy 
)

Determines the height of the terrain at a given position.

Parameters:
wx world coordinates x
wz world coordinates y
wy place to store the height in world coordinates
Returns:
errorcode

ES3Denum ES3D::Terrainf::loadDetailTexturef ( const char *const   filename,
GLuint  repeat 
)

Loads the detail texture. Former texture are cleaned up automatically

Parameters:
filename the filename of the texture
repeat times to repeat the detail map
Returns:
errocode

ES3Denum ES3D::Terrainf::loadHeightMapf ( const char *const   filename,
GLfloat  xzstep,
GLfloat  ystep 
)

Loads the height map. Former height maps are cleaned up automatically

Parameters:
filename the filename of the height map. Must be 8 bit color greyscale
xzstep the step between each xy vertex in world space
ystep the step/scaling of the height
Returns:
errocode

ES3Denum ES3D::Terrainf::loadTextureMapf ( const char *const   filename  ) 

Loads the texture. Former texture are cleaned up automatically

Parameters:
filename the filename of the texture
Returns:
errocode

ES3Denum ES3D::Terrainf::prepareGeneratedTextureMapf ( GLuint  width,
GLuint  numberTiles 
)

Prepares the generation of the texture map. Former texture are cleaned up automatically

Parameters:
width the width (and height) of the texture map
numberTiles the number of tiles to generate the detailed map
Returns:
errocode

GLvoid ES3D::Terrainf::renderf ( GLvoid   )  const

Renders the terrain with the current parameters

GLvoid ES3D::Terrainf::resetf ( GLvoid   ) 

Restets and cleans up all data

GLvoid ES3D::Terrainf::updatef ( GLuint  time  ) 

Updates the terrain (if necessary) by time.

Parameters:
time the elapsed time by one frame

GLvoid ES3D::Terrainf::updateROAMf ( const GLfloat  pivot[3],
const GLfloat  direction[3],
const GLfloat  angle,
const GLint  delta,
const GLfloat  distance,
const GLfloat  tolerance 
)

Update the ROAM parameters

Parameters:
pivot the pivot of the area which is split
direction the direction of the area which is split
angle the angle of the area which is split
delta if this delta value to higher than the variance, the triangle is also split
distance triangles outside this distance are not split
tomerance tolerance area where no split and no merge is done


Member Data Documentation

GLfloat ES3D::Terrainf::ambientFactor = 0.05f [static]

Ambient factor, Only used for simulated light.

GLfloat ES3D::Terrainf::position[3]

The position of the terrain in world space


The documentation for this class was generated from the following files:
Generated on Sat May 10 16:30:56 2008 for ES 3D Game SDK Documentation by  doxygen 1.4.7