#include <Terrainf.h>
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 |
ES3D::Terrainf::Terrainf | ( | ) |
Constructor
ES3D::Terrainf::~Terrainf | ( | ) | [virtual] |
Destructor
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.
filename | the filename of the tile | |
hundredPercentAt | the value where the tiel does have hundred percent |
GLvoid ES3D::Terrainf::disableROAMf | ( | GLvoid | ) |
Disables ROAM for this terrain
ES3Denum ES3D::Terrainf::enableLightf | ( | ES3Denum | mode | ) |
Enables / disables light for the terrain
mode | mode, if light should be turned of or not |
GLvoid ES3D::Terrainf::enableROAMf | ( | GLuint | minDetail, | |
GLuint | maxDetail | |||
) |
Enables ROAM for this terrain
minDetail | minimum detail | |
maxDetail | maximum detail |
ES3Denum ES3D::Terrainf::generateTextureMapf | ( | GLuint | repeat | ) |
Generates a texture map out of the given tiles
repeat | the times how often a tile is repeated on the map |
ES3Denum ES3D::Terrainf::getHeightAtf | ( | GLfloat | wx, | |
GLfloat | wz, | |||
GLfloat & | wy | |||
) |
Determines the height of the terrain at a given position.
wx | world coordinates x | |
wz | world coordinates y | |
wy | place to store the height in world coordinates |
ES3Denum ES3D::Terrainf::loadDetailTexturef | ( | const char *const | filename, | |
GLuint | repeat | |||
) |
Loads the detail texture. Former texture are cleaned up automatically
filename | the filename of the texture | |
repeat | times to repeat the detail map |
ES3Denum ES3D::Terrainf::loadHeightMapf | ( | const char *const | filename, | |
GLfloat | xzstep, | |||
GLfloat | ystep | |||
) |
Loads the height map. Former height maps are cleaned up automatically
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 |
ES3Denum ES3D::Terrainf::loadTextureMapf | ( | const char *const | filename | ) |
Loads the texture. Former texture are cleaned up automatically
filename | the filename of the texture |
ES3Denum ES3D::Terrainf::prepareGeneratedTextureMapf | ( | GLuint | width, | |
GLuint | numberTiles | |||
) |
Prepares the generation of the texture map. Former texture are cleaned up automatically
width | the width (and height) of the texture map | |
numberTiles | the number of tiles to generate the detailed map |
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.
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
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 |
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