Inherits from CC3DrawableVertexArray : CC3VertexArray : CC3Identifiable : NSObject
Declared in CC3VertexArrays.h

Overview

A CC3VertexArray that manages the location aspect 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.

Since the vertex locations determine the size and shape of the mesh, this class is also responsible for determining the boundingBox of the mesh.

Properties

__deprecated

@deprecated Renamed to firstVertex.

@property (nonatomic, assign) GLuint firstElement __deprecated

Declared In

CC3VertexArrays.h

boundingBox

Returns the axially-aligned bounding box of this mesh.

@property (nonatomic, readonly) CC3Box boundingBox

Declared In

CC3VertexArrays.h

centerOfGeometry

Returns the center of geometry of this mesh.

@property (nonatomic, readonly) CC3Vector centerOfGeometry

Declared In

CC3VertexArrays.h

firstVertex

An index reference to the first element that will be drawn.

@property (nonatomic, assign) GLuint firstVertex

Discussion

Typically, all vertices are to be drawn, and this property will be zero. In some applications, large sets of underlying content may be used for the vertex arrays of more than one mesh. In such a case, it may be desirable to start drawing from an vertex that is not the first vertex of the array. This property can be set to indicate at which element index to start drawing. If drawing is being performed in strips, this will be the index of the start of the first strip to be drawn.

The initial value is zero.

Declared In

CC3VertexArrays.h

radius

Returns the radius of a spherical boundary, centered on the centerOfGeometry, that encompasses all the vertices of this mesh.

@property (nonatomic, readonly) GLfloat radius

Declared In

CC3VertexArrays.h

Instance Methods

faceAt:

Returns the face from the mesh at the specified index.

- (CC3Face)faceAt:(GLuint)faceIndex

Discussion

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 face structure contains only the locations of the vertices. If the vertex locations are interleaved with other vertex content, such as color or texture coordinates, or other padding, that content will not appear in the returned face structure.

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

This method is only meaningful if the vertices are drawn directly from this vertex array, without using vertex indexing. If vertex indexing is in use (the mesh contains an instance of CC3VertexIndices) the order of the vertices in this array will likely not be accurate.

Declared In

CC3VertexArrays.h

faceFromIndices:

Returns the mesh face that is made up of the three vertices at the three indices within the specified face indices structure. Because indexing is used, the three vertices that make up the face may not be contiguous within this array.

- (CC3Face)faceFromIndices:(CC3FaceIndices)faceIndices

Discussion

The returned face structure contains only the locations of the vertices. If the vertex locations are interleaved with other vertex content, such as color or texture coordinates, or other padding, that content will not appear in the returned face structure.

Declared In

CC3VertexArrays.h

homogeneousLocationAt:

Returns the location element at the specified index in the underlying vertex content, as a four-dimensional location in the 4D homogeneous coordinate space.

- (CC3Vector4)homogeneousLocationAt:(GLuint)index

Discussion

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

This implementation takes into consideration the elementSize property. If the value of the elementSize property is 3, the returned vector will contain one in the W component. If the value of the elementSize property is 2, the returned vector will contain zero in the Z component and one in the W component.

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

Declared In

CC3VertexArrays.h

locationAt:

Returns the location element at the specified index in the underlying vertex content.

- (CC3Vector)locationAt:(GLuint)index

Discussion

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

This implementation takes into consideration the elementSize property. If the value of the elementSize property is 2, the returned vector will contain zero in the Z component.

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

Declared In

CC3VertexArrays.h

markBoundaryDirty

Marks the boundary, including bounding box and radius, as dirty, and need of recalculation.

- (void)markBoundaryDirty

Declared In

CC3VertexArrays.h

moveMeshOriginTo:

Changes the mesh vertices so that the origin of the mesh is at the specified location.

- (void)moveMeshOriginTo:(CC3Vector)aLocation

Discussion

The origin of the mesh is the location (0,0,0) in the local coordinate system, and is the location around which all transforms are performed.

This method can be used to adjust the mesh structure to make it easier to apply transformations, by moving the origin of the transformations to a more convenient location in the mesh.

This method changes the location component of every vertex in the mesh. This can be quite costly, and should only be performed once, to adjust a mesh so that it is easier to manipulate. As an alternate, you should consider changing the origin of the mesh at development time using a 3D editor.

Do not use this method to move your model around. Instead, use the transform properties (location, rotation and scale) of the CC3MeshNode that contains this mesh, and let the GL engine do the heavy lifting of transforming the mesh vertices.

If this mesh is being used by any mesh nodes, be sure to invoke the markBoundingVolumeDirty method on all nodes that use this mesh, to ensure that the boundingVolume is recalculated using the new location values. Invoking this method on the CC3MeshNode instead will automatically invoke the markBoundingVolumeDirty method.

This method ensures that the GL VBO that holds the vertex data is updated.

Declared In

CC3VertexArrays.h

moveMeshOriginToCenterOfGeometry

Changes the mesh vertices so that the origin of the mesh is at the center of geometry of the mesh.

- (void)moveMeshOriginToCenterOfGeometry

Discussion

The origin of the mesh is the location (0,0,0) in the local coordinate system, and is the location around which all transforms are performed.

This method can be used to adjust the mesh structure to make it easier to apply transformations, by moving the origin of the transformations to the center of the mesh.

This method changes the location component of every vertex in the mesh. This can be quite costly, and should only be performed once, to adjust a mesh so that it is easier to manipulate. As an alternate, you should consider changing the origin of the mesh at development time using a 3D editor.

Do not use this method to move your model around. Instead, use the transform properties (location, rotation and scale) of the CC3MeshNode that contains this mesh, and let the GL engine do the heavy lifting of transforming the mesh vertices.

If this mesh is being used by any mesh nodes, be sure to invoke the markBoundingVolumeDirty method on all nodes that use this mesh, to ensure that the boundingVolume is recalculated using the new location values. Invoking this method on the CC3MeshNode instead will automatically invoke the markBoundingVolumeDirty method.

This method ensures that the GL VBO that holds the vertex data is updated.

Declared In

CC3VertexArrays.h

movePivotTo:

@deprecated Renamed to moveMeshOriginTo:.

- (void)movePivotTo:(CC3Vector)aLocation

Declared In

CC3VertexArrays.h

movePivotToCenterOfGeometry

@deprecated Renamed to moveMeshOriginToCenterOfGeometry.

- (void)movePivotToCenterOfGeometry

Declared In

CC3VertexArrays.h

setElementsFromCPODData:fromSPODMesh:

CC3VertexLocations manages freeing either dedicated or interleaved data

- (void)setElementsFromCPODData:(CPODData *)aCPODData fromSPODMesh:(SPODMesh *)aSPODMesh

Declared In

CC3VertexArraysPODExtensions.mm

setHomogeneousLocation:at:

Sets the location element at the specified index in the underlying vertex content to the specified four-dimensional location in the 4D homogeneous coordinate space.

- (void)setHomogeneousLocation:(CC3Vector4)aLocation at:(GLuint)index

Discussion

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

This implementation takes into consideration the elementSize property. If the value of the elementSize property is 3, the W component of the specified vector will be ignored. If the value of the elementSize property is 2, both the W and Z components of the specified vector will be ignored.

If the new vertex location changes the bounding box of this instance, and this instance is being used by any mesh nodes, be sure to invoke the markBoundingVolumeDirty method on all mesh nodes that use this vertex array, to ensure that the boundingVolume encompasses the new vertex location.

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

Declared In

CC3VertexArrays.h

setLocation:at:

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

- (void)setLocation:(CC3Vector)aLocation at:(GLuint)index

Discussion

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

This implementation takes into consideration the elementSize property. If the value of the elementSize property is 2, the Z component of the specified vector will be ignored. If the value of the elementSize property is 4, the specified vector will be converted to a 4D vector, with the W component set to one, before storing.

If the new vertex location changes the bounding box of this instance, and this instance is being used by any mesh nodes, be sure to invoke the markBoundingVolumeDirty method on all mesh nodes that use this vertex array, to ensure that the boundingVolume encompasses the new vertex location.

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

Declared In

CC3VertexArrays.h