ES3D::Terrainx Class Reference

#include <Terrainx.h>

List of all members.

Public Member Functions

 Terrainx ()
virtual ~Terrainx ()
ES3Denum loadHeightMapx (const char *const filename, FixedPointx xzstep, FixedPointx ystep)
ES3Denum loadTextureMapx (const char *const filename)
ES3Denum prepareGeneratedTextureMapx (GLuint width, GLuint numberTiles)
ES3Denum addTilex (const char *const filename, GLubyte hundredPercentAt)
ES3Denum generateTextureMapx (GLuint repeat)
ES3Denum enableLightx (ES3Denum mode)
ES3Denum loadDetailTexturex (const char *const filename, GLuint repeat)
GLvoid updatex (GLuint time)
GLvoid renderx (GLvoid) const
GLvoid resetx (GLvoid)
ES3Denum getHeightAtx (FixedPointx wx, FixedPointx wz, FixedPointx &wy)
GLvoid enableROAMx (GLuint minDetail, GLuint maxDetail)
GLvoid updateROAMx (const FixedPointx pivot[3], const FixedPointx direction[3], const FixedPointx angle, const GLint delta, const FixedPointx distance, const FixedPointx tolerance)
GLvoid disableROAMx (GLvoid)

Public Attributes

FixedPointx position [3]

Static Public Attributes

static FixedPointx ambientFactor = (FixedPointx)INT2FIXED(5)/(FixedPointx)INT2FIXED(100)


Detailed Description

Terrain class


Constructor & Destructor Documentation

ES3D::Terrainx::Terrainx (  ) 

Constructor

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

Destructor


Member Function Documentation

ES3Denum ES3D::Terrainx::addTilex ( 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::Terrainx::disableROAMx ( GLvoid   ) 

Disables ROAM for this terrain

ES3Denum ES3D::Terrainx::enableLightx ( ES3Denum  mode  ) 

Enables / disables light for the terrain

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

GLvoid ES3D::Terrainx::enableROAMx ( GLuint  minDetail,
GLuint  maxDetail 
)

Enables ROAM for this terrain

Parameters:
minDetail minimum detail
maxDetail maximum detail

ES3Denum ES3D::Terrainx::generateTextureMapx ( 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::Terrainx::getHeightAtx ( FixedPointx  wx,
FixedPointx  wz,
FixedPointx 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::Terrainx::loadDetailTexturex ( 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::Terrainx::loadHeightMapx ( const char *const   filename,
FixedPointx  xzstep,
FixedPointx  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::Terrainx::loadTextureMapx ( const char *const   filename  ) 

Loads the texture. Former texture are cleaned up automatically

Parameters:
filename the filename of the texture
Returns:
errocode

ES3Denum ES3D::Terrainx::prepareGeneratedTextureMapx ( 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::Terrainx::renderx ( GLvoid   )  const

Renders the terrain with the current parameters

GLvoid ES3D::Terrainx::resetx ( GLvoid   ) 

Restets and cleans up all data

GLvoid ES3D::Terrainx::updateROAMx ( const FixedPointx  pivot[3],
const FixedPointx  direction[3],
const FixedPointx  angle,
const GLint  delta,
const FixedPointx  distance,
const FixedPointx  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

GLvoid ES3D::Terrainx::updatex ( GLuint  time  ) 

Updates the terrain (if necessary) by time.

Parameters:
time the elapsed time by one frame


Member Data Documentation

FixedPointx ES3D::Terrainx::ambientFactor = (FixedPointx)INT2FIXED(5)/(FixedPointx)INT2FIXED(100) [static]

Ambient factor, Only used for simulated light.

FixedPointx ES3D::Terrainx::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