Eidolon
Public Member Functions | Private Attributes | List of all members
MatrixVertexBuffer Class Reference

#include <RenderTypes.h>

Inheritance diagram for MatrixVertexBuffer:
Inheritance graph
Collaboration diagram for MatrixVertexBuffer:
Collaboration graph

Public Member Functions

 MatrixVertexBuffer (Vec3Matrix *vecs, ColorMatrix *cols=NULL, IndexMatrix *extinds=NULL) throw (RenderException)
 Create the buffer from these matrices, vecs.m() in (1,2,4). The caller is responsible for deleting these when appropriate. More...
 
 MatrixVertexBuffer (const VertexBuffer *buf) throw (RenderException)
 Copy the data from `buf' into internal matrices which this object is responsible for and will delete in its destructor. More...
 
virtual ~MatrixVertexBuffer ()
 
sval getIndex (sval i) const
 
virtual vec3 getVertex (int i) const
 Returns the i'th vertex, i<numVertices() More...
 
virtual vec3 getNormal (int i) const
 Returns the i'th normal, i<numVertices() More...
 
virtual color getColor (int i) const
 Returns the i'th color, i<numVertices() More...
 
virtual vec3 getUVWCoord (int i) const
 Returns the i'th UVW texture coord, i<numVertices() More...
 
virtual sval numVertices () const
 Returns number of total vertices. More...
 
virtual bool hasNormal () const
 Returns true if the buffer contains normal data. More...
 
virtual bool hasColor () const
 Returns true if the buffer contains color data. More...
 
virtual bool hasUVWCoord () const
 Returns true if the buffer contains texture coord data. More...
 
- Public Member Functions inherited from VertexBuffer
virtual ~VertexBuffer ()
 

Private Attributes

Vec3Matrixvecs
 
ColorMatrixcols
 
IndexMatrixextinds
 
sval numverts
 
bool deleteMatrices
 

Detailed Description

Implementation of a VertexBuffer which uses matrices for storage. This assumes the input Vec3Matrix has 1, 2, or 4 columns, which are the position, normal, xi coordinate, and UVW coordinate components per node. The method hasNormal() returns true if there's more than one column, and hasUVWCoord() is true if there's more than 3, therefore the xi column must be present but is ignored. A copy constructor allows the copying of buffer data into a MatrixVertexBuffer object which retains ownership of the internal matrices and delete them when cleaned up. Matrices passed in through the normal constructor remain the responsibility of the caller.

Constructor & Destructor Documentation

◆ MatrixVertexBuffer() [1/2]

MatrixVertexBuffer ( Vec3Matrix vecs,
ColorMatrix cols = NULL,
IndexMatrix extinds = NULL 
)
throw (RenderException
)
inline

Create the buffer from these matrices, vecs.m() in (1,2,4). The caller is responsible for deleting these when appropriate.

Here is the call graph for this function:

◆ MatrixVertexBuffer() [2/2]

MatrixVertexBuffer ( const VertexBuffer buf)
throw (RenderException
)
inline

Copy the data from `buf' into internal matrices which this object is responsible for and will delete in its destructor.

Here is the call graph for this function:

◆ ~MatrixVertexBuffer()

virtual ~MatrixVertexBuffer ( )
inlinevirtual

Member Function Documentation

◆ getColor()

virtual color getColor ( int  i) const
inlinevirtual

Returns the i'th color, i<numVertices()

Reimplemented from VertexBuffer.

Here is the call graph for this function:

◆ getIndex()

sval getIndex ( sval  i) const
inline
Here is the call graph for this function:

◆ getNormal()

virtual vec3 getNormal ( int  i) const
inlinevirtual

Returns the i'th normal, i<numVertices()

Reimplemented from VertexBuffer.

Here is the call graph for this function:

◆ getUVWCoord()

virtual vec3 getUVWCoord ( int  i) const
inlinevirtual

Returns the i'th UVW texture coord, i<numVertices()

Reimplemented from VertexBuffer.

Here is the call graph for this function:

◆ getVertex()

virtual vec3 getVertex ( int  i) const
inlinevirtual

Returns the i'th vertex, i<numVertices()

Reimplemented from VertexBuffer.

Here is the call graph for this function:

◆ hasColor()

virtual bool hasColor ( ) const
inlinevirtual

Returns true if the buffer contains color data.

Reimplemented from VertexBuffer.

◆ hasNormal()

virtual bool hasNormal ( ) const
inlinevirtual

Returns true if the buffer contains normal data.

Reimplemented from VertexBuffer.

Here is the call graph for this function:

◆ hasUVWCoord()

virtual bool hasUVWCoord ( ) const
inlinevirtual

Returns true if the buffer contains texture coord data.

Reimplemented from VertexBuffer.

Here is the call graph for this function:

◆ numVertices()

virtual sval numVertices ( ) const
inlinevirtual

Returns number of total vertices.

Reimplemented from VertexBuffer.

Member Data Documentation

◆ cols

ColorMatrix* cols
private

◆ deleteMatrices

bool deleteMatrices
private

◆ extinds

IndexMatrix* extinds
private

◆ numverts

sval numverts
private

◆ vecs

Vec3Matrix* vecs
private

The documentation for this class was generated from the following file: