Public Member Functions

CC3VertexIndices Class Reference

A CC3VertexArray that manages the drawing indices of an array of vertices. More...

#import <CC3VertexArrays.h>

Inheritance diagram for CC3VertexIndices:
Inheritance graph
[legend]
Collaboration diagram for CC3VertexIndices:
Collaboration graph
[legend]

List of all members.

Public Member Functions

(GLushort) - indexAt:
(void) - setIndex:at:

Detailed Description

A CC3VertexArray that manages the drawing indices of an array of vertices.

This class is also a type of CC3DrawableVertexArray, and as such, is capable of drawing the vertices to the GL engine.

A vertex index array is different than other vertex arrays in that instead of managing actual vertex data, it manages indexes that reference the elements of the other vertex arrays. The bufferTarget property is GL_ELEMENT_ARRAY_BUFFER, the elementSize property is 1, and the elementType is either GL_UNSIGNED_SHORT or GL_UNSIGNED_BYTE

Because an index datum does not describe an aspect of a particular vertex, but rather points to a vertex, index data cannot be interleaved with the vertex data. As such, the data underlying a CC3VertexIndices is never interleaved and shared with the data underlying the other vertex arrays in a mesh.


Member Function Documentation

- (GLushort) indexAt: (GLsizei)  index

Returns the index element at the specified index in the underlying vertex data.

The index refers to elements, not bytes. The implementation takes into consideration the elementStride and elementOffset properties to access the correct element.

If the releaseRedundantData method has been invoked and the underlying vertex data has been released, this method will raise an assertion exception.

- (void) setIndex: (GLushort)  vertexIndex
at: (GLsizei)  index 

Sets the index element at the specified index in the underlying vertex data to the specified value.

The index refers to elements, not bytes. The implementation takes into consideration the elementStride and elementOffset properties to access the correct element.

If the releaseRedundantData method has been invoked and the underlying vertex data has been released, this method will raise an assertion exception.


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