GpuThesis::Terrain Class Reference

#include <Terrain.h>

Inheritance diagram for GpuThesis::Terrain:

GpuThesis::SceneObject List of all members.

Public Member Functions

 Terrain (unsigned int width, unsigned int height, const std::string &texture, float amplitude, float frequency, float textureScale, float scale, bool useVBO=true)
void setMaterial (const Material &material)
float getHeight (float x, float y) const
GLuint getTexture () const
void transform ()
void render (unsigned int meshNumber=0)
bool isLit ()
unsigned int getMeshCount ()
const MaterialgetMaterial (unsigned int meshNumber)
void setPosition (const Math::Vector3d &position)
void setRotationAxis (const Math::Vector3d &rotationAxis)
void setRotationAngle (float angle)

Detailed Description

Terrain class. Represents a noisy surface.


Constructor & Destructor Documentation

GpuThesis::Terrain::Terrain unsigned int  width,
unsigned int  height,
const std::string &  texture,
float  amplitude,
float  frequency,
float  textureScale,
float  scale,
bool  useVBO = true
 

Initialize the terrain.

Parameters:
width the width in vertices.
height the height in vertices.
texture the texture to use.
amplitude the amplitude of the terrain.
frequency the frequency of the terrain (the smaller the smoother).
textureScale the scale of the texture.
scale the scale of the terrain.
useVBO whether to use vertex buffer objects (currently required for texturing).


Member Function Documentation

float GpuThesis::Terrain::getHeight float  x,
float  y
const
 

Get the height of the terrain at the given coordinates.

Returns:
the terrain height.

const Material & GpuThesis::Terrain::getMaterial unsigned int  meshNumber  )  [virtual]
 

Get the material of the given mesh.

Parameters:
meshNumber the given mesh.
Returns:
the material.

Implements GpuThesis::SceneObject.

unsigned int GpuThesis::Terrain::getMeshCount  )  [virtual]
 

Get the mesh count of the terrain.

Returns:
the terrain's mesh count.

Implements GpuThesis::SceneObject.

GLuint GpuThesis::Terrain::getTexture  )  const
 

Get the texture used by the terrain.

Returns:
the OpenGL texture id.

bool GpuThesis::Terrain::isLit  )  [virtual]
 

Check whether the terrain should be lit.

Returns:
whether the terrain should be lit.

Implements GpuThesis::SceneObject.

void GpuThesis::Terrain::render unsigned int  meshNumber = 0  )  [virtual]
 

Render the terrain.

Implements GpuThesis::SceneObject.

void GpuThesis::Terrain::setMaterial const Material material  ) 
 

Set the material.

Parameters:
material the material.

void GpuThesis::Terrain::setPosition const Math::Vector3d &  position  ) 
 

Set the terrain position.

Parameters:
position the new position.

void GpuThesis::Terrain::setRotationAngle float  angle  ) 
 

Set the rotation angle.

Parameters:
angle the new rotation angle.

void GpuThesis::Terrain::setRotationAxis const Math::Vector3d &  rotationAxis  ) 
 

Set the rotation axis.

Parameters:
rotationAxis the new rotation axis.

void GpuThesis::Terrain::transform  )  [virtual]
 

Transform the terrain.

Implements GpuThesis::SceneObject.


The documentation for this class was generated from the following files:
Generated on Fri Jun 16 08:42:51 2006 for GPU Thesis by  doxygen 1.4.6-NO