#include <ovmesh.h>
Public Member Functions | |
| OVMesh () | |
| Constructor for ovmesh. | |
| ~OVMesh () | |
| Destructor for ovmesh. | |
| void | GenerateGrid (int resX, int resY, float x0, float x1, float y0, float y1, bool vertical) |
| Generates a grid. | |
| void | CreateVBO () |
| Creates a Vertex Buffer Object (VBO). | |
| void | DeleteVBO () |
| Deletes a Vertex Buffer Object (VBO). | |
| void | DrawOpenGL () |
| Draws the mesh using OpenGL. | |
| void | DrawVBO () |
| Draws the mesh as a Vertex Buffer Object (VBO). | |
| unsigned int | GetNumTriangles () |
| Calculates the number of triangles (faces) in the grid. | |
Private Member Functions | |
| void | m_AddVertex (float x, float y, float z) |
| Adds a vertex in the list of vertices. | |
| void | m_Clear () |
| Clears the vertex list and the face list. | |
Private Attributes | |
| int | m_numVertices |
| int | m_numFaces |
| GLfloat * | m_vertArray |
| GLuint * | m_faceArray |
| GLuint | m_vertexVBO |
| GLuint | m_indexVBO |
Defines a horizontal or vertical grid. Support for VBO also included.
| OV::OVMesh::OVMesh | ( | ) |
Constructor for ovmesh.
| OV::OVMesh::~OVMesh | ( | ) |
Destructor for ovmesh.
| void OV::OVMesh::GenerateGrid | ( | int | resX, | |
| int | resY, | |||
| float | x0, | |||
| float | x1, | |||
| float | y0, | |||
| float | y1, | |||
| bool | vertical | |||
| ) |
Generates a grid.
Generates a rectangular grid between (x0,y0) and (x1,y1). If vertical is TRUE the grid will be in the xy-plane, otherwise it will be in the xz-plane.
| resX | the resolution in the x direction. | |
| resY | the resolution in the y(z) direction. | |
| x0 | the x component of the starting point. | |
| x1 | the x component of the ending point. | |
| y0 | the y component of the starting point. | |
| y1 | the y component of the ending point. | |
| vertical | decides if the grid is vertical or horizontal. |
| void OV::OVMesh::CreateVBO | ( | ) |
Creates a Vertex Buffer Object (VBO).
| void OV::OVMesh::DeleteVBO | ( | ) |
Deletes a Vertex Buffer Object (VBO).
| void OV::OVMesh::DrawOpenGL | ( | ) |
Draws the mesh using OpenGL.
Draws the mesh using glDrawElements and offline arrays of vertices.
| void OV::OVMesh::DrawVBO | ( | ) |
Draws the mesh as a Vertex Buffer Object (VBO).
Draws the mesh using glDrawElements and a VBO stored in video RAM.
| unsigned int OV::OVMesh::GetNumTriangles | ( | ) |
Calculates the number of triangles (faces) in the grid.
| void OV::OVMesh::m_AddVertex | ( | float | x, | |
| float | y, | |||
| float | z | |||
| ) | [private] |
Adds a vertex in the list of vertices.
| void OV::OVMesh::m_Clear | ( | ) | [private] |
Clears the vertex list and the face list.
int OV::OVMesh::m_numVertices [private] |
Number of vertices
int OV::OVMesh::m_numFaces [private] |
Number of triangles
GLfloat* OV::OVMesh::m_vertArray [private] |
List of vertices
GLuint* OV::OVMesh::m_faceArray [private] |
List of faces
GLuint OV::OVMesh::m_vertexVBO [private] |
Identification for VBO
GLuint OV::OVMesh::m_indexVBO [private] |
Identification for VBO
1.5.2