CVertexStream Class Reference

Implementation of the IVertexStream interface. More...

Inheritance diagram for CVertexStream:

IVertexStream

List of all members.

Public Member Functions

 CVertexStream (int numVertices)
 Construcs a vertex stream objecct with space for a given number of vertices.
void coumputeTangentVectors (void)
 Computes tangent space vectors 'tangent' and 'bitangent'.
float computeBoundingRadius (void)
 Computes the bounding radius.
void render (int primitiveType, const vec4_t *overrideColor, const VertexAttribLocations *attribs)
 Sends the stream to OpenGL.
void renderNormals (void)
 Draws the normals of all vertices.
void renderTangentVectors (void)
 Draw the basis vectors of the tangent space for all vertices.
vec3_tv (void)
 Returns the vertex position array.
vec3_tn (void)
 Returns the normal array.
vec2_tt (void)
 Returns the tex coord array.
vec4_tc (void)
 Returns the primary color array.
vec3_ttan1 (void)
 Returns the tangent array.
vec3_ttan2 (void)
 Returns the bitangent array.

Classes

struct  tanSpace_s
 The custom vertex attributes, currently ony the tangent space vectors.


Detailed Description

Implementation of the IVertexStream interface.

The methods work like described in IVertexStream.


Constructor & Destructor Documentation

CVertexStream::CVertexStream ( int  numVertices  ) 

Construcs a vertex stream objecct with space for a given number of vertices.

Parameters:
numVertices Number of vertices this stream can contains.


Member Function Documentation

void CVertexStream::coumputeTangentVectors ( void   )  [virtual]

Computes tangent space vectors 'tangent' and 'bitangent'.

Warning:
Assumes individual triangles are stored in the stream. Calculates for each triangle in the buffer the vertex attributes 'attrTangent' and 'attrBitangent'. These vectors are based on the vertex normals, texture coords and positions.

Implements IVertexStream.

float CVertexStream::computeBoundingRadius ( void   )  [virtual]

Computes the bounding radius.

It simply returns the maximum length of all vertex positions stored in the stream.

Returns:
The bounding radius

Implements IVertexStream.

void CVertexStream::render ( int  primitiveType,
const vec4_t overrideColor,
const VertexAttribLocations attribs 
) [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.

Parameters:
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.

Implements IVertexStream.

void CVertexStream::renderNormals ( void   )  [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.

Implements IVertexStream.

void CVertexStream::renderTangentVectors ( void   )  [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.

Implements IVertexStream.


The documentation for this class was generated from the following file:
Generated on Sun Mar 2 17:12:32 2008 for Shader Maker by  doxygen 1.5.4