Generates a mesh using a Heightmap for use with a renderer.
More...
|
void | initaliseHeightmap (std::string mapFileLocation, std::vector< float > &vertices, std::vector< float > &vertexNormals, std::vector< float > &vertexTextures, std::vector< unsigned int > &indices) |
| Initalises a heightmap. More...
|
|
Uint32 | getPixel (int x, int y, uint8_t bpp, SDL_Surface *map) |
| A function to get a pixel from a map. More...
|
|
Vec3 | getNormal (Vec3 a, Vec3 b, Vec3 c) |
| A function to get a normal from 3 vectors. More...
|
|
Generates a mesh using a Heightmap for use with a renderer.
◆ getNormal()
A function to get a normal from 3 vectors.
- Parameters
-
a | Vector A. |
B | Vector B. |
c | Vector C. |
- Returns
- A normal of the 3 vectors
◆ getPixel()
Uint32 Heightmap::getPixel |
( |
int |
x, |
|
|
int |
y, |
|
|
uint8_t |
bpp, |
|
|
SDL_Surface * |
map |
|
) |
| |
A function to get a pixel from a map.
- Parameters
-
x | The x position of the pixel. |
y | The y position of the pixel. |
bpp | The bits per pixel. |
nap | A pointer to the map to search. |
- Returns
- A pixel.
◆ initaliseHeightmap()
void Heightmap::initaliseHeightmap |
( |
std::string |
mapFileLocation, |
|
|
std::vector< float > & |
vertices, |
|
|
std::vector< float > & |
vertexNormals, |
|
|
std::vector< float > & |
vertexTextures, |
|
|
std::vector< unsigned int > & |
indices |
|
) |
| |
Initalises a heightmap.
- Parameters
-
mapFileLocation | The map files location. |
vertices | A referecne to vertices vector. |
vertexNormals | A referecne to vertex Normals vector. |
vertexTextures | A referecne to vertex Textures vector. |
indices | A referecne to indices vector. |