#include <VertexArrayObject.h>
Inheritance diagram for VertexArrayObject:
Public Member Functions | |
VertexArrayObject () | |
~VertexArrayObject () | |
virtual void | Draw () |
double | GetBoundingRadius () |
BoundingBox | GetBoundingBox () |
void | PrintToConsole () |
void | ComputeNormals (bool clock_wise) |
void | ComputeSphericalTextureCoordinates (GLuint texture_id) |
Static Public Attributes | |
static bool | show_normals = false |
static float | normal_length = 3.0f |
Protected Member Functions | |
void | SetVertexData (float *data, int num_vertices) |
void | SetVertexIndices (GLuint *indices, int num_faces) |
void | SetTextureCoordinates (float *data, GLuint texture_id) |
Private Member Functions | |
void | Draw_Normals () |
void | ComputeBoundingVolumes () |
Private Attributes | |
float * | vertex_pointer |
int | num_vertices |
GLuint * | index_pointer |
int | num_faces |
float * | normal_pointer |
float * | texture_pointer |
GLuint | texture_id |
bool | bounding_volumes_computed |
BoundingBox | bounding_box |
double | bounding_radius |
A VertexArrayObject is a specialized form of a RawObjects that supports vertex arrays to display itself. Additional functionality includes the automated calculation of the bounding box as well as the bounding sphere of the object from the vertex data, the computation of the normals of the object from the vertex and index data of the object anf finally a spherical texture coordinate generation routine.
Definition at line 21 of file VertexArrayObject.h.
|
Constructor: Brings the object into a consistent state. Definition at line 4 of file VertexArrayObject.cpp. |
|
Destructor. Definition at line 17 of file VertexArrayObject.cpp. |
|
Computes the bounding box and bounding radius from the vertex data. Definition at line 207 of file VertexArrayObject.cpp. |
|
Computes the normals of the object from the vertex and index data. Normals are built by averaging for each point the normals of all the faces that use that point. These normals are additionally weighted by the width of the angle of the respecive faces.
Definition at line 112 of file VertexArrayObject.cpp. |
|
Computes spherical texture coordinates (and the normal data if necessary) for the object.
Definition at line 189 of file VertexArrayObject.cpp. |
|
Draws the vertex array object. Reimplemented from RawObject. Definition at line 60 of file VertexArrayObject.cpp. |
|
Draws the normals of the object. Definition at line 93 of file VertexArrayObject.cpp. |
|
Implementation of the GetBoundingBox routine. Iterates over the vertex data and computes the minimal and maximal distance along each axis. Reimplemented from RawObject. Reimplemented in Torus2. Definition at line 52 of file VertexArrayObject.cpp. |
|
Implementation of the GetBoundingRadius routine. Iterates over the vertex data and returns the maximal distance from the origin. Reimplemented from RawObject. Reimplemented in Torus2. Definition at line 44 of file VertexArrayObject.cpp. |
|
Prints information about this object to the console. Definition at line 244 of file VertexArrayObject.cpp. |
|
Sets the texture coordinates for the vertex data. One texture coordinate must consist of exaclty 2 consecutive floating point values (u, v).
Definition at line 38 of file VertexArrayObject.cpp. |
|
Sets the vertex data. One vertex must consist of 3 consecutive floating point values (x, y, z).
Definition at line 25 of file VertexArrayObject.cpp. |
|
Sets the indices for the vertex data that define the polygon faces.
Definition at line 32 of file VertexArrayObject.cpp. |
|
Internal, precomputed bounding box. Definition at line 142 of file VertexArrayObject.h. |
|
Internal, precomputed bounding radius. Definition at line 145 of file VertexArrayObject.h. |
|
Internal flag indicating wheather the bounding volumes have already been computed or not. Definition at line 139 of file VertexArrayObject.h. |
|
Internal pointer to the index data. Definition at line 124 of file VertexArrayObject.h. |
|
Lenght of the normals to be drawn. Definition at line 77 of file VertexArrayObject.h. |
|
Internal pointer to the normal data. Definition at line 130 of file VertexArrayObject.h. |
|
Number of faces contained within the index data. Definition at line 127 of file VertexArrayObject.h. |
|
Number of vertices contained within the vertex data. Definition at line 121 of file VertexArrayObject.h. |
|
If set to 'true', the normals of the VertexArrayObjects will be drawn whenever such an object is drawn. Definition at line 74 of file VertexArrayObject.h. |
|
Internal storage of the OpenGL texture name which shall be used along the texture coordinates. Definition at line 136 of file VertexArrayObject.h. |
|
Internal pointer to the texture coordinate data. Definition at line 133 of file VertexArrayObject.h. |
|
Internal pointer to the vertex data. Definition at line 118 of file VertexArrayObject.h. |