Model Class Reference

#include <Model.h>

Inheritance diagram for Model:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 Model ()
 Model (char *desc_file)
virtual ~Model ()
 Any model data assocated with this object is deleted when the object is deallocated.
int loadModel (const char *path)
 Load a modelfile to this model object.
void clear ()
 Delete any model data assocated with this object.

Static Public Member Functions

static void DrawVertexArray (const GLfloat *vertices, const GLuint *indices, GLint count)
 Draw a full-vertex array (i.e.

Public Attributes

GLfloat * vertices
 Vertices (3D) to draw (pass to glVertexPointer).
GLuint * indices
 Indices in vertices used to draw the GL_TRIANGLES that make up the model.
long indexCount
 Number of indices.
long vertexCount
 Number of vertices.

Protected Member Functions

int readVertices (FILE *modFile)
int readFaces (FILE *modFile)

Protected Attributes

char rsrcKey [32]

Friends

class ModelResource

Constructor & Destructor Documentation

Model::Model (  ) 

Model::Model ( char *  desc_file  ) 

virtual Model::~Model (  )  [virtual]

Any model data assocated with this object is deleted when the object is deallocated.


Member Function Documentation

void Model::clear (  ) 

Delete any model data assocated with this object.

static void Model::DrawVertexArray ( const GLfloat *  vertices,
const GLuint *  indices,
GLint  count 
) [static]

Draw a full-vertex array (i.e.

a vertex array with vertices, normals and texture coordinates.

Parameters:
vertices pointer to vertex data
indices array of indices into vertices to draw
count the number of vertex entries (i.e. a 1/3 of the number of indices).

int Model::loadModel ( const char *  path  ) 

Load a modelfile to this model object.

Any previous model data assocated with this object is deleted.

Parameters:
path Path to the model file.
Returns:
0 on success, -EIO if the file could not be parsed, an errno error otherwise.

int Model::readFaces ( FILE *  modFile  )  [protected]

int Model::readVertices ( FILE *  modFile  )  [protected]


Friends And Related Function Documentation

friend class ModelResource [friend]


Member Data Documentation

long Model::indexCount

Number of indices.

GLuint* Model::indices

Indices in vertices used to draw the GL_TRIANGLES that make up the model.

(pass to glDrawElements)

char Model::rsrcKey[32] [protected]

long Model::vertexCount

Number of vertices.

GLfloat* Model::vertices

Vertices (3D) to draw (pass to glVertexPointer).


The documentation for this class was generated from the following file:
Generated on Sun Mar 11 15:33:26 2007 for MetalWarriors by  doxygen 1.4.7