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
posVect 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)

Function that sets the Light colors of the Terrain.

This function takes a single color vect and applies it to the ambient, diffuse, and specular light of the Terrain Object.

Parameters
lightColColor vect for ambient, diffuse, and specular light
void Terrain::SetLightColors ( const Vect &  amb,
const Vect &  diff,
const Vect &  spec 
)

Function that sets the Light colors of the Terrain.

This function takes in (and applies) a seperate color vect for the ambient, diffuse, and specular light of the Terrain Object.

Parameters
ambColor vect for ambient light
diffColor vect for diffuse light
specColor vect for specular light
void Terrain::SetTexture ( Texture *  tex)

Function that sets the Terrain's texture.

Parameters
texA pointer to the Texture to be used
void Terrain::SetWorld ( const Matrix &  mat)

Function that sets the world matrix of the Terrain.

Parameters
matA const Matrix reference for the world.