#include <vertexstream.h>
Public Member Functions | |
virtual | ~IVertexStream (void) |
Destructor, provided for compatibility. | |
virtual void | coumputeTangentVectors (void)=0 |
Computes tangent space vectors 'tangent' and 'bitangent'. | |
virtual float | computeBoundingRadius (void)=0 |
Computes the bounding radius. | |
virtual void | render (int primitiveType, const vec4_t *overrideColor=NULL, const VertexAttribLocations *attribs=NULL)=0 |
Sends the stream to OpenGL. | |
virtual void | renderNormals (void)=0 |
Draws the normals of all vertices. | |
virtual void | renderTangentVectors (void)=0 |
Draw the basis vectors of the tangent space for all vertices. | |
virtual vec3_t * | v (void)=0 |
Returns the vertex position array. | |
virtual vec3_t * | n (void)=0 |
Returns the normal array. | |
virtual vec2_t * | t (void)=0 |
Returns the tex coord array. | |
virtual vec4_t * | c (void)=0 |
Returns the primary color array. | |
virtual vec3_t * | tan1 (void)=0 |
Returns the tangent array. | |
virtual vec3_t * | tan2 (void)=0 |
Returns the bitangent array. | |
Static Public Member Functions | |
static IVertexStream * | create (int numVertices) |
creates an IVertexStream object. |
The container is an easy-to-use wrapper for OpenGL vertex arrays. It supports some custom vertex attributes for vertex shaders.
IVertexStream * IVertexStream::create | ( | int | numVertices | ) | [static] |
creates an IVertexStream object.
numVertices | Number of vertices available in the buffer. |
virtual void IVertexStream::coumputeTangentVectors | ( | void | ) | [pure virtual] |
Computes tangent space vectors 'tangent' and 'bitangent'.
Implemented in CVertexStream.
virtual float IVertexStream::computeBoundingRadius | ( | void | ) | [pure virtual] |
Computes the bounding radius.
It simply returns the maximum length of all vertex positions stored in the stream.
Implemented in CVertexStream.
virtual void IVertexStream::render | ( | int | primitiveType, | |
const vec4_t * | overrideColor = NULL , |
|||
const VertexAttribLocations * | attribs = NULL | |||
) | [pure virtual] |
Sends the stream to OpenGL.
It setups OpenGL client state, binds vertex arrays, draws the complete array and cleans up the GL client state.
primitiveType | The primitive type that is passed to OpenGL. | |
overrideColor | If != NULL, this color will be passed to OpenGL instead of the colors stored in the stream. | |
attribs | If != NULL the custom vertex attributes are send to the locations defined in the parameter. |
Implemented in CVertexStream.
virtual void IVertexStream::renderNormals | ( | void | ) | [pure virtual] |
Draws the normals of all vertices.
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.
Implemented in CVertexStream.
virtual void IVertexStream::renderTangentVectors | ( | void | ) | [pure virtual] |
Draw the basis vectors of the tangent space for all vertices.
It draws a line from the vertex position in the direction of each tangent space vector. Tangent == red, Bitangent == green, Normal == blue.
Implemented in CVertexStream.