#include <Terrainx.h>
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) |
| ES3D::Terrainx::Terrainx | ( | ) |
Constructor
| ES3D::Terrainx::~Terrainx | ( | ) | [virtual] |
Destructor
| 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.
| filename | the filename of the tile | |
| hundredPercentAt | the value where the tiel does have hundred percent |
| GLvoid ES3D::Terrainx::disableROAMx | ( | GLvoid | ) |
Disables ROAM for this terrain
| ES3Denum ES3D::Terrainx::enableLightx | ( | ES3Denum | mode | ) |
Enables / disables light for the terrain
| mode | mode, if light should be turned of or not |
| GLvoid ES3D::Terrainx::enableROAMx | ( | GLuint | minDetail, | |
| GLuint | maxDetail | |||
| ) |
Enables ROAM for this terrain
| minDetail | minimum detail | |
| maxDetail | maximum detail |
| ES3Denum ES3D::Terrainx::generateTextureMapx | ( | 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::Terrainx::getHeightAtx | ( | FixedPointx | wx, | |
| FixedPointx | wz, | |||
| FixedPointx & | 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::Terrainx::loadDetailTexturex | ( | 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::Terrainx::loadHeightMapx | ( | const char *const | filename, | |
| FixedPointx | xzstep, | |||
| FixedPointx | 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::Terrainx::loadTextureMapx | ( | const char *const | filename | ) |
Loads the texture. Former texture are cleaned up automatically
| filename | the filename of the texture |
| ES3Denum ES3D::Terrainx::prepareGeneratedTextureMapx | ( | 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::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
| 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.
| time | the elapsed time by one frame |
FixedPointx ES3D::Terrainx::ambientFactor = (FixedPointx)INT2FIXED(5)/(FixedPointx)INT2FIXED(100) [static] |
Ambient factor, Only used for simulated light.
The position of the terrain in world space
1.4.7