Public Member Functions | Properties

CC3VertexLocations Class Reference

A CC3VertexArray that manages the location aspect of an array of vertices. More...

#import <CC3VertexArrays.h>

Inheritance diagram for CC3VertexLocations:
CC3DrawableVertexArray CC3VertexArray CC3Identifiable

List of all members.

Public Member Functions

(void) - buildBoundingBox
(CC3Vector- locationAt:
(void) - setLocation:at:

Properties

CC3BoundingBox boundingBox
CC3Vector centerOfGeometry
GLuint firstElement

Detailed Description

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.


Member Function Documentation

- (void) buildBoundingBox

Calculates and populates the boundingBox and centerOfGeometry properties from the vertex locations.

This method is invoked automatically from the buildVolume method of CC3NodeBoundingVolume subclasses that are aware of CC3VertexLocations. Usually, the application never needs to invoke this method directly.

- (CC3Vector) locationAt: (GLsizei)  index

Returns the location 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 createGLBuffer method has been invoked and the underlying vertex data has been released, this method will raise an assertion exception.

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

Sets the location element at the specified index in the underlying vertex data to the specified location 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 createGLBuffer method has been invoked and the underlying vertex data has been released, this method will raise an assertion exception.


Property Documentation

- (CC3BoundingBox) boundingBox [read, assign]

Returns the axially-aligned bounding box of this mesh.

This is calculated by the buildBoundingBox method.

- (CC3Vector) centerOfGeometry [read, assign]

Returns the center of geometry of this mesh.

This is calculated by the buildBoundingBox method.

- (GLuint) firstElement [read, write, assign]

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

Typically, all elements are to be drawn, and this property will be zero. In some applications, large sets of underlying data 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 element that is not the first element 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.

Implements CC3DrawableVertexArray.


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