Public Member Functions

CC3VertexMatrixIndices Class Reference

A CC3VertexArray that manages a collection of indices used by each vertex to point to a collection of distinct matrices during vertex skinning. More...

#import <CC3VertexArrays.h>

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

List of all members.

Public Member Functions

(GLuint) - matrixIndexForVertexUnit:at:
(GLvoid *) - matrixIndicesAt:
(void) - setMatrixIndex:forVertexUnit:at:
(void) - setMatrixIndices:at:

Detailed Description

A CC3VertexArray that manages a collection of indices used by each vertex to point to a collection of distinct matrices during vertex skinning.

Vertex skinning is the manipulation of a soft-body mesh under control of a skeleton of bone nodes.

This vertex array works together with an instace of a CC3VertexWeights vertex array, and the elementSize property of the two vertex arrays must be equal, and must not be larger than the maximum number of available vertex units for the platform, which can be retreived from [CC3OpenGLES11Engine engine].platform.maxVertexUnits.value.


Member Function Documentation

- (GLuint) matrixIndexForVertexUnit: (GLuint)  vertexUnit
at: (GLuint)  index 

Returns the matrix index element, for the specified vertex unit, at the specified index in the underlying vertex content.

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

Several matrix indices are stored for each vertex, one per vertex unit, corresponding to one for each bone that influences the location of the vertex. The specified vertexUnit parameter must be between zero inclusive, and the elementSize property, exclusive.

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

- (GLvoid*) matrixIndicesAt: (GLuint)  index

Returns a pointer to an array of the matrix indices at the specified vertex index in the underlying vertex content.

Several matrix index values are stored for each vertex, one per vertex unit, corresponding to one for each bone that influences the location of the vertex. The number of elements in the returned array is the same for all vertices in this array, and can be retrieved from the elementSize property.

The matrix indices can be stored in this array as either type GLushort or type GLubyte. The returned array will be of the type of index stored by this vertex array, and it is up to the application to know which type will be returned, and cast the returned array accordingly. The type can be determined by the elementType property of this array, which will return one of GL_UNSIGNED_SHORT or GL_UNSIGNED_BYTE, respectively.

To avoid checking the elementType altogether, you can use the matrixIndexForVertexUnit:at: method, which retrieves the matrix index values one at a time, and automatically converts the stored type to GLushort.

The index refers to vertices, not bytes. The implementation takes into consideration the vertexStride and elementOffset properties to access the correct vertices.

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

- (void) setMatrixIndex: (GLuint)  aMatrixIndex
forVertexUnit: (GLuint)  vertexUnit
at: (GLuint)  index 

Sets the matrix index element, for the specified vertex unit, at the specified index in the underlying vertex content, to the specified value.

Several matrix indices are stored for each vertex, one per vertex unit, corresponding to one for each bone that influences the location of the vertex. The specified vertexUnit parameter must be between zero inclusive, and the elementSize property, exclusive.

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

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

- (void) setMatrixIndices: (GLvoid *)  mtxIndices
at: (GLuint)  index 

Sets the matrix index elements at the specified vertex index in the underlying vertex content, to the values in the specified array.

Several matrix index values are stored for each vertex, one per vertex unit, corresponding to one for each bone that influences the location of the vertex. The number of elements is the same for all vertices in this array, and can be retrieved from the elementSize property. The number of elements in the specified input array must therefore be at least as large as the value of the elementSize property.

The matrix indices can be stored in this array as either type GLushort or type GLubyte. The specified array must be of the type of index stored by this vertex array, and it is up to the application to know which type is required, and provide that type of array accordingly. The type can be determined by the elementType property of this array, which will return one of GL_UNSIGNED_SHORT or GL_UNSIGNED_BYTE, respectively.

To avoid checking the elementType altogether, you can use the setMatrixIndex:forVertexUnit:at: method, which sets the matrix index values one at a time, and automatically converts the input type to the correct stored type.

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

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


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