Mesh Class Reference

Models a triangle mesh. More...

#include <Mesh.h>

Inheritance diagram for Mesh:

Object3d ViewObject Object

List of all members.

Public Member Functions

 Mesh ()
 Standard constructor.
 Mesh (const Mesh &source)
 Copy Constructor.
 Mesh (const string &meshFilename, const string &textureFilename, const string &shaderFilename)
 Creates mesh from vef file.
 ~Mesh ()
 Destructor.
void renderGl ()
 Draw the mesh.
void selectGl ()
 Picking rendering for OpenGL.
void setMaterial (const PhongMaterial &material)
 Setter for Material.
void setTexture (const Texture &texture)
 Setter for Texture.
Shader getShader ()
 Getter for Shader.
virtual string toString () const
 Returns a textual representation.
virtual string className () const
 Returns the class name of the object.
virtual enum classId classId () const
 Returns the class id of the object.

Private Member Functions

void createVBO ()
 Creates a vertex buffer object for the mesh.
void calculateNormals ()
 Calculates the normals for each vertex.

Private Attributes

Vbo meshData
 The triangle mesh data.
PhongMaterial material
 Phong material properties.
Texture texDiffuse
 Texture this mesh should use.
Shader shader
 Shader this mesh should use.
string filename
 Reference to file (for later reloads).


Detailed Description

Models a triangle mesh.

Contains the vertices, the triangle list and the normal list of the mesh


Constructor & Destructor Documentation

Mesh::Mesh (  ) 

Standard constructor.

Mesh::Mesh ( const Mesh source  ) 

Copy Constructor.

Mesh::Mesh ( const string &  meshFilename,
const string &  textureFilename,
const string &  shaderFilename 
)

Creates mesh from vef file.

Opens and loads a bmm-file with a texture and shader

Mesh::~Mesh (  ) 

Destructor.


Member Function Documentation

void Mesh::createVBO (  )  [private]

Creates a vertex buffer object for the mesh.

void Mesh::calculateNormals (  )  [private]

Calculates the normals for each vertex.

void Mesh::renderGl (  )  [virtual]

Draw the mesh.

All OpenGl commands that have to be executed by the Mesh for each frame by the GLRenderer.

Parameters:
time The time since application start

Implements Object3d.

void Mesh::selectGl (  )  [virtual]

Picking rendering for OpenGL.

Renders the Object for object picking in OpenGL

Implements Object3d.

void Mesh::setMaterial ( const PhongMaterial material  ) 

Setter for Material.

Setter for Material

void Mesh::setTexture ( const Texture texture  ) 

Setter for Texture.

Setter for Texture

Shader Mesh::getShader (  ) 

Getter for Shader.

Getter for Shader

string Mesh::toString (  )  const [virtual]

Returns a textual representation.

Returns:
a string descriping the run-time object

Reimplemented from Object3d.

string Mesh::className (  )  const [virtual]

Returns the class name of the object.

Returns:
a string with the name of the object's class

Reimplemented from Object3d.

enum classId Mesh::classId (  )  const [virtual]

Returns the class id of the object.

Returns:
an id of the object's class

Reimplemented from Object3d.


Member Data Documentation

Vbo Mesh::meshData [private]

The triangle mesh data.

Phong material properties.

Texture this mesh should use.

Shader Mesh::shader [private]

Shader this mesh should use.

string Mesh::filename [private]

Reference to file (for later reloads).


The documentation for this class was generated from the following files:

Generated on Mon Jul 7 13:30:34 2008 for Firefly by  doxygen 1.5.6