Level H Engine
Functions
Heightmap Namespace Reference

Generates a mesh using a Heightmap for use with a renderer. More...

Functions

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...
 

Detailed Description

Generates a mesh using a Heightmap for use with a renderer.

Function Documentation

◆ getNormal()

Vec3 Heightmap::getNormal ( Vec3  a,
Vec3  b,
Vec3  c 
)

A function to get a normal from 3 vectors.

Parameters
aVector A.
BVector B.
cVector C.
Returns
A normal of the 3 vectors
Here is the caller graph for this function:

◆ getPixel()

Uint32 Heightmap::getPixel ( int  x,
int  y,
uint8_t  bpp,
SDL_Surface *  map 
)

A function to get a pixel from a map.

Parameters
xThe x position of the pixel.
yThe y position of the pixel.
bppThe bits per pixel.
napA pointer to the map to search.
Returns
A pixel.
Here is the caller graph for this function:

◆ 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
mapFileLocationThe map files location.
verticesA referecne to vertices vector.
vertexNormalsA referecne to vertex Normals vector.
vertexTexturesA referecne to vertex Textures vector.
indicesA referecne to indices vector.
Here is the call graph for this function:
Here is the caller graph for this function: