v2.0.2
Instance Methods | List of all members
CC3VertexIndices Class Reference

#import <CC3VertexArrays.h>

Inheritance diagram for CC3VertexIndices:
Inheritance graph
[legend]

Instance Methods

(GLuint *) - allocateTriangles:
 
(void) - copyVertices:from:to:offsettingBy:
 
(void) - copyVertices:from:toAddress:offsettingBy:
 
(void) - copyVertices:fromAddress:to:offsettingBy:
 
(void) - copyVertices:fromAddress:toAddress:offsettingBy:
 
(CC3FaceIndices- faceIndicesAt:
 
(GLuint) - indexAt:
 
(void) - populateFromRunLengthArray:ofLength:
 
(void) - setIndex:at:
 
- Instance Methods inherited from CC3DrawableVertexArray
(void) - allocateStripLengths:
 
(void) - deallocateStripLengths
 
(void) - drawFrom:forCount:withVisitor:
 
(void) - drawWithVisitor:
 
(GLuint) - faceCountFromVertexCount:
 
(GLuint) - faceCountFromVertexIndexCount:
 
(GLuint) - vertexCountFromFaceCount:
 
(GLuint) - vertexIndexCountFromFaceCount:
 
- Instance Methods inherited from CC3VertexArray
(void) - __deprecated
 
(NSString *) - __deprecated
 
(void) - __deprecated
 
(GLvoid *) - addressOfElement:
 
(GLvoid *) - allocateElements:
 
(void) - bindContentToAttributeAt:withVisitor:
 
(void) - copyVertices:from:to:
 
(void) - copyVertices:from:toAddress:
 
(void) - copyVertices:fromAddress:to:
 
(void) - copyVertices:fromAddress:toAddress:
 
(void) - createGLBuffer
 
(void) - deleteGLBuffer
 
(NSString *) - describeElements:
 
(NSString *) - describeElements:startingAt:
 
(NSString *) - describeVertices
 
(NSString *) - describeVertices:
 
(NSString *) - describeVertices:startingAt:
 
(BOOL) - ensureCapacity:
 
(id) - initFromCPODData:fromSPODMesh:
 
(GLvoid *) - interleaveWith:
 
(GLvoid *) - interleaveWith:usingOffset:
 
(GLvoid *) - reallocateElements:
 
(void) - releaseRedundantContent
 
(void) - updateGLBuffer
 
(void) - updateGLBufferStartingAt:forLength:
 
- Instance Methods inherited from CC3Identifiable
(id) - copy
 
(id) - copyAsClass:
 
(void) - copyUserDataFrom:
 
(id) - copyWithName:
 
(id) - copyWithName:asClass:
 
(id) - copyWithZone:withName:
 
(id) - copyWithZone:withName:asClass:
 
(BOOL) - deriveNameFrom:
 
(BOOL) - deriveNameFrom:usingSuffix:
 
(NSString *) - fullDescription
 
(id) - init
 
(id) - initAtIndex:fromPODResource:
 
(void) - initUserData
 
(id) - initWithName:
 
(id) - initWithTag:
 
(id) - initWithTag:withName:
 
(GLuint) - nextTag
 
(void) - populateFrom:
 

Additional Inherited Members

- Class Methods inherited from CC3VertexArray
(id) + arrayFromCPODData:fromSPODMesh:
 
(GLenum) + defaultSemantic
 
(id) + vertexArray
 
(id) + vertexArrayWithName:
 
(id) + vertexArrayWithTag:
 
(id) + vertexArrayWithTag:withName:
 
- Properties inherited from CC3DrawableVertexArray
GLuint firstElement __deprecated
 
GLenum drawingMode
 
GLuint faceCount
 
GLuint stripCount
 
GLuint * stripLengths
 

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 content, it manages indexes that reference the vertices 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 content cannot be interleaved with the vertex content. As such, the content underlying a CC3VertexIndices is never interleaved and shared with the content underlying the other vertex arrays in a mesh.

Method Documentation

- (GLuint*) allocateTriangles: (GLuint)  triangleCount
Deprecated:
Use allocatedVertexCapacity property instead.
- (void) copyVertices: (GLuint)  vtxCount
from: (GLuint)  srcIdx
to: (GLuint)  dstIdx
offsettingBy: (GLint)  offset 

Copies vertex indices for the specified number of vertices from memory starting at the specified source vertex index to memory starting at the specified destination vertex index, and offsets each value by the specified offset amount.

The value at the destination vertex will be that of the source vertex, plus the specified offset.

You can use this method to copy content from one area in the vertex array to another area, while adjusting for movement of the underlying vertex content pointed to by these vertex indices.

- (void) copyVertices: (GLuint)  vtxCount
from: (GLuint)  srcIdx
toAddress: (GLvoid *)  dstPtr
offsettingBy: (GLint)  offset 

Copies vertex indices for the specified number of vertices from memory starting at the specified source vertex index to memory starting at the specified destination address pointer, and offsets each value by the specified offset amount.

The value at the destination vertex will be that of the source vertex, plus the specified offset.

You can use this method to copy content out of this vertex array to a memory location outside this vertex array, while adjusting for movement of the underlying vertex content pointed to by these vertex indices.

This is a fast copy that assumes that the vertex content at the destination is of the same type (GL_UNSIGNED_BYTE or GL_UNSIGNED_SHORT) as the vertex content in this vertex array.

- (void) copyVertices: (GLuint)  vtxCount
fromAddress: (GLvoid *)  srcPtr
to: (GLuint)  dstIdx
offsettingBy: (GLint)  offset 

Copies vertex indices for the specified number of vertices from memory starting at the specified source address pointer to memory starting at the specified destination vertex index, and offsets each value by the specified offset amount.

The value at the destination vertex will be that of the source vertex, plus the specified offset.

You can use this method to copy content into this vertex array from a memory location outside this vertex array, while adjusting for movement of the underlying vertex content pointed to by these vertex indices.

This is a fast copy that assumes that the vertex content at the source is of the same type (GL_UNSIGNED_BYTE or GL_UNSIGNED_SHORT) as the vertex content in this vertex array.

- (void) copyVertices: (GLuint)  vtxCount
fromAddress: (GLvoid *)  srcPtr
toAddress: (GLvoid *)  dstPtr
offsettingBy: (GLint)  offset 

Copies vertex content for the specified number of vertices from memory starting at the specified source address to memory starting at the specified destination address.

You can use this method to copy content between two memory location outside this vertex array.

This is a fast straight memory copy, assumes that vertex content is consecutive and is spaced as defined by the vertexStride property, and that the vertex content at both the source and destination addresses are structured identically to the content of this vertex array. If vertex content is interleaved, the content in between consecutive elements of this vertex array will also be copied. Copies vertex indices for the specified number of vertices from memory starting at the specified source address pointer to memory starting at the specified destination address pointer, and offsets each value by the specified offset amount. The value at the destination vertex will be that of the source vertex, plus the specified offset.

You can use this method to copy content between two memory location outside this vertex array, while adjusting for movement of the underlying vertex content pointed to by these vertex indices.

This is a fast copy that assumes that the vertex content at the source and destination is of the same type (GL_UNSIGNED_BYTE or GL_UNSIGNED_SHORT) as the vertex content in this vertex array.

- (CC3FaceIndices) faceIndicesAt: (GLuint)  faceIndex

Returns the vertex indices of the face from the mesh at the specified index.

The specified faceIndex value refers to the index of the face, not the vertices themselves. So, a value of 5 will retrieve the three vertices that make up the fifth triangular face in this mesh. The specified index must be between zero, inclusive, and the value of the faceCount property, exclusive.

The returned structure reference contains the indices of the three vertices that make up the triangular face. These indices index into the actual vertex locations in the CC3VertexLocations array.

This method takes into consideration the drawingMode of this vertex array, and any padding (stride) between the vertex indices.

The indices in the returned face are of type GLuint, regardless of whether the elementType property is GL_UNSIGNED_SHORT or GL_UNSIGNED_BYTE.

Implements CC3DrawableVertexArray.

- (GLuint) indexAt: (GLuint)  index

Returns the index element 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.

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

- (void) populateFromRunLengthArray: (GLushort *)  runLenArray
ofLength: (GLuint)  rlaLen 

Convenience method to populate this index array from the specified run-length encoded array.

Run-length encoded arrays are used to compactly store a set of variable-length sub-arrays of indexes, where the first element of each sub-array indicates the number of content elements contained in that sub-array.

For example, if the first element of the array (element zero) contains the value 5, then the next 5 elements of the array contain the first 5 content elements of the first sub-array. Then the next element of the array (element 6) contains the length of the second sub-array, and so on.

The total number of elements in the run-length array, including the run-length entries is specified by the rlaLen parameter.

Run-length encoded arrays are of limited use as GL index arrays, because they cannot easily be copied into, and managed as a VBO in the GL engine, which is a performance hinderance. And becuase run-length encoded arrays intermix vertex indices and run lengths, it makes accessing individual vertex indices and faces unwieldy.

- (void) setIndex: (GLuint)  vertexIndex
at: (GLuint)  index 

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

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

If the releaseRedundantContent 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: