Terrain class for 3D terrain. More...
#include <Terrain.h>
Inherits RenderType.
Detailed Description
Terrain class for 3D terrain.
The Terrain Object allows users to define a 3D textured and lit terrain based off of a heightmap texture. The class also provides various functions for interacting with the terrain.
Public Member Functions | |
| void | SetWorld (const Matrix &mat) |
| Function that sets the world matrix of the Terrain. More... | |
| Matrix & | GetWorld () |
| Function that gets the world matrix of the Terrain. More... | |
| void | SetLightColors (const Vect &lightCol) |
| Function that sets the Light colors of the Terrain. More... | |
| void | SetLightColors (const Vect &amb, const Vect &diff, const Vect &spec) |
| Function that sets the Light colors of the Terrain. More... | |
| void | SetTexture (Texture *tex) |
| Function that sets the Terrain's texture. More... | |
| Vect | GetSurfacePoint (const Vect &pos) |
| Function that finds the surface point from a given world position. More... | |
Member Function Documentation
| Vect Terrain::GetSurfacePoint | ( | const Vect & | pos | ) |
Function that finds the surface point from a given world position.
This function takes in a vector position in world space and returns a similar vector position with an adjusted Y to the Terrain's surface. If the provided position is not above or below the Terrain then the returning vector will have a Y of zero.
- Parameters
-
pos Vect position in world space
- Returns
- Vect position of surface point
| Matrix& Terrain::GetWorld | ( | ) |
Function that gets the world matrix of the Terrain.
- Returns
- reference to world Matrix.
| void Terrain::SetLightColors | ( | const Vect & | lightCol | ) |
| void Terrain::SetLightColors | ( | const Vect & | amb, |
| const Vect & | diff, | ||
| const Vect & | spec | ||
| ) |
| void Terrain::SetTexture | ( | Texture * | tex | ) |
Function that sets the Terrain's texture.
- Parameters
-
tex A pointer to the Texture to be used
| void Terrain::SetWorld | ( | const Matrix & | mat | ) |
Function that sets the world matrix of the Terrain.
- Parameters
-
mat A const Matrix reference for the world.

1.8.11