Public Member Functions | |
CObjModel (void) | |
Constructs a CObjModel object. | |
QString | getName (void) |
Returns the name of this model. | |
void | render (const VertexAttribLocations *attribs, const vec4_t *overrideColor) |
Sends the stored geometry to OpenGL via vertex arrays. | |
void | renderNormals (void) |
Draws the vertex normals stored in this model. | |
void | renderTangents (void) |
Draw vertex tangent space basis stored in this model. | |
int | getPrimitiveType (void) |
Returns the primitive type of this model. | |
QString | getPrimitiveTypeName (void) |
Returns the primitive type if this model in a human readable format. | |
float | getBoundingRadius (void) |
Returns the bounding radius of this model. | |
void | getBoundingBox (vec3_t &mins, vec3_t &maxs) |
Returns the bounding box of this model. | |
bool | loadObjModel (const QString &fileName) |
Loads a model from a file. | |
void | printStatistics (void) const |
Prints mesh statistics to stderr. | |
Classes | |
class | AutoWaitCursor |
Helper class for displaying the wait cursor. | |
class | Face |
Face information. | |
class | Index |
Helper for indexing the data arrays. |
CObjModel::CObjModel | ( | void | ) |
Constructs a CObjModel object.
QString CObjModel::getName | ( | void | ) | [inline, virtual] |
void CObjModel::render | ( | const VertexAttribLocations * | attribs, | |
const vec4_t * | overrideColor | |||
) | [virtual] |
Sends the stored geometry to OpenGL via vertex arrays.
It enables OpenGL client state, binds vertex arrays, draws them and disables the client state.
attribs | Custom vertex attribute locations. If this model has these attributes available, they will be bound to the indexed custom vertex attributes. If one of these attributes is -1, it will not be used. If this parameters is set to NULL, no custom attributes will be used. | |
overrideColor | If this parameters if != NULL, then this color will be used as vertex color instead of the values stored in this model. |
Implements IModel.
void CObjModel::renderNormals | ( | void | ) | [virtual] |
Draws the vertex normals stored in this model.
If no normal are available, this call has no effect. It loops through all vertices and draws a colored line starting at the vertex position and pointing into the normal's direction. The colors are chosen from the largest component: x == red, Y == green, Z == blue.
Implements IModel.
void CObjModel::renderTangents | ( | void | ) | [virtual] |
Draw vertex tangent space basis stored in this model.
If no tangent space vectors are available, this call has no effect. Otherwise it draws a line from the vertex position in the direction of each tangent space vector. Tangent == red, Bitangent == green, Normal == blue.
Implements IModel.
int CObjModel::getPrimitiveType | ( | void | ) | [virtual] |
Returns the primitive type of this model.
It assumes that the model is constructed of only one primitive type.
Implements IModel.
QString CObjModel::getPrimitiveTypeName | ( | void | ) | [virtual] |
Returns the primitive type if this model in a human readable format.
It assumes that the model is constructeed of only one primitive type.
Implements IModel.
float CObjModel::getBoundingRadius | ( | void | ) | [virtual] |
Returns the bounding radius of this model.
Implements IModel.
Returns the bounding box of this model.
The bounding box is defined by minimum and maximum coordinates.
mins | Buffer to store the minimum coordiantes of the bounding box. | |
maxs | Buffer to store the maximum coordiantes of the bounding box. |
Implements IModel.
bool CObjModel::loadObjModel | ( | const QString & | fileName | ) | [virtual] |
Loads a model from a file.
The file to load is assumed to be of .OBJ format. If loading fails, then this object looses the data stored in it.
fileName | Name of the file to load. |
Implements IMeshModel.
void CObjModel::printStatistics | ( | void | ) | const |
Prints mesh statistics to stderr.