IVertexStream Class Reference

An interface to a generic vertex data container. More...

#include <vertexstream.h>

Inheritance diagram for IVertexStream:

CVertexStream

List of all members.

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_tv (void)=0
 Returns the vertex position array.
virtual vec3_tn (void)=0
 Returns the normal array.
virtual vec2_tt (void)=0
 Returns the tex coord array.
virtual vec4_tc (void)=0
 Returns the primary color array.
virtual vec3_ttan1 (void)=0
 Returns the tangent array.
virtual vec3_ttan2 (void)=0
 Returns the bitangent array.

Static Public Member Functions

static IVertexStreamcreate (int numVertices)
 creates an IVertexStream object.


Detailed Description

An interface to a generic vertex data container.

The container is an easy-to-use wrapper for OpenGL vertex arrays. It supports some custom vertex attributes for vertex shaders.


Member Function Documentation

IVertexStream * IVertexStream::create ( int  numVertices  )  [static]

creates an IVertexStream object.

Parameters:
numVertices Number of vertices available in the buffer.

virtual void IVertexStream::coumputeTangentVectors ( void   )  [pure 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.

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.

Returns:
The bounding radius

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.

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.

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.


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