Cutout Vis2012
TUWienVisualisierung2(SS2012)-AdaptiveCutaways
|
#include <Mesh.h>
Public Member Functions | |
void | init (int numVertices, GLfloat *vertices, GLfloat *normals, GLfloat *texCoords, GLenum primitiveMode, bool adjacency=false) |
void | init (int numVertices, GLfloat *vertices, GLfloat *normals, GLfloat *texCoords, int numIndices, GLuint *indices, GLenum primitiveMode, bool adjacency=false) |
void | init (const MeshDescriptor &descr) |
void | setTexture (Texture *texture) |
const Texture * | getTexture () const |
void | bindVAO () const |
void | unbindVAO () const |
void | draw () const |
void | drawLines () const |
bool | hasIndices () const |
bool | hasNormals () const |
bool | hasTexCoords () const |
bool | hasColors () const |
int | getNumIndices () const |
int | getNumVertices () const |
GLenum | getPrimitiveMode () const |
const GLfloat * | getVertices () const |
const GLfloat * | getNormals () const |
const GLfloat * | getTexCoords () const |
const GLfloat * | getColors () const |
const GLuint * | getIndices () const |
void | calculateMinMax (bool overrideCurrent=false) |
bool | hasMinMax () const |
void | getMin (float &outX, float &outY, float &outZ) const |
void | getMax (float &outX, float &outY, float &outZ) const |
Encapsulated GL state of a mesh. Consists of a VAO that stores some or all of the following: vertex positions, normals, texture coordinates, vertex colors and indices.
void Mesh::bindVAO | ( | ) | const |
Binds the VAO that describes this mesh to the GL
void Mesh::calculateMinMax | ( | bool | overrideCurrent = false ) |
Calculates the minimal axis-aligned bounding box for this mesh.
overrideCurrent | if true, the method calculates the AABB anew even if it is already set |
void Mesh::draw | ( | ) | const |
Issues a draw call to the GL that renders a triangle mesh.
void Mesh::drawLines | ( | ) | const |
unused
const Texture * Mesh::getTexture | ( | ) | const |
unused
void Mesh::init | ( | const MeshDescriptor & | descr) |
Generates a VAO that holds the data from descr
. Accords to the layout location conventions used in all the shaders throughout this project.
void Mesh::setTexture | ( | Texture * | texture) |
unused
void Mesh::unbindVAO | ( | ) | const |
Unbinds the VAO that describes this mesh to the GL