GluonGraphics::Mesh Class Reference

A collection of vertices that combine to an object. More...

#include <mesh.h>

Inheritance diagram for GluonGraphics::Mesh:
QObject

List of all members.

Classes

class  MeshPrivate

Public Member Functions

 Mesh (QObject *parent=0)
virtual ~Mesh ()
virtual void load (const QString &filename)
virtual bool isLoaded ()
virtual void render (MaterialInstance *material)

Protected Member Functions

virtual void createBuffer (const QVector< float > &vertices, const QVector< float > &colors, const QVector< float > &uvs)
virtual void renderBuffer (uint mode, int count, GluonGraphics::MaterialInstance *material)

Detailed Description

A collection of vertices that combine to an object.

A mesh contains all the vertex data of an object. This vertex data is used to render triangles on the screen.

Definition at line 41 of file mesh.h.


Constructor & Destructor Documentation

Mesh::Mesh ( QObject parent = 0  ) 

Definition at line 56 of file mesh.cpp.

Mesh::~Mesh (  )  [virtual]

Definition at line 63 of file mesh.cpp.


Member Function Documentation

void Mesh::createBuffer ( const QVector< float > &  vertices,
const QVector< float > &  colors,
const QVector< float > &  uvs 
) [protected, virtual]

Create an OpenGL buffer to store data and store the data passed as arguments.

Parameters:
vertices The vertex positions to store in the buffer.
Parameters:
colors The vertex colors to store in the buffer.
Parameters:
uvs The UV coordinate data to store in the buffer.

Definition at line 121 of file mesh.cpp.

bool Mesh::isLoaded (  )  [virtual]

Has this mesh been loaded yet?

Definition at line 115 of file mesh.cpp.

void Mesh::load ( const QString &  filename  )  [virtual]

Load the data for this mesh.

Parameters:
filename The name of the file to load.

Definition at line 69 of file mesh.cpp.

void Mesh::render ( MaterialInstance material  )  [virtual]

Render this mesh to the screen.

Parameters:
material The material used to render the mesh. This is only used to determine vertex attribute locations in the program.

Definition at line 109 of file mesh.cpp.

void Mesh::renderBuffer ( uint  mode,
int  count,
GluonGraphics::MaterialInstance material 
) [protected, virtual]

Render the local OpenGL buffer.

Parameters:
mode The OpenGL mode to use, for example GL_TRIAGLES.
Parameters:
count The number of vertices to render.
Parameters:
material The material to get attribute locations from.

Definition at line 135 of file mesh.cpp.


The documentation for this class was generated from the following files:
Generated on Mon Dec 27 13:13:43 2010 for Gluon by  doxygen 1.6.3