Public Member Functions | Properties

CC3PointParticleMesh Class Reference

A mesh whose vertices are used to display point particles. More...

#import <CC3PointParticles.h>

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

List of all members.

Public Member Functions

(void) - DEPRECATED_ATTRIBUTE
(GLfloat) - particleSizeAt:
(void) - setParticleSize:at:

Properties

GLuint particleCount DEPRECATED_ATTRIBUTE
CC3VertexContent vertexContentTypes
CC3VertexPointSizesvertexPointSizes

Detailed Description

A mesh whose vertices are used to display point particles.

This mesh adds the vertexPointSizes property to add a vertex array that manages an optional particle size content for each vertex.

Each vertex in the vertex arrays defines the visual characteristics for single point particle. As with any other mesh, this content must include a location, so the vertexLocations array is required by this model. In addition, optional characteristics may be specified for each vertex: particle normal, color and size. Therefore, instances of this mesh may also include vertexNormals, vertexColors, and vertexPointSizes arrays..

Since only one vertex is used per point particle, and that data is usually updated frequently by the application, there is little advantage to using indices during drawing. In general, therefore, this mesh will not typically make use of a vertexIndices array.

This subclass also contains several properties and population methods to assist in accessing and managing the data in the vertex arrays.

When creating a particle system, you do not typically need to interact with this class, or create a customized subclass of CC3PointParticleMesh.


Member Function Documentation

Deprecated:
Replaced by updatePointSizesGLBuffer.

Implements CC3Mesh.

- (GLfloat) particleSizeAt: (GLuint)  DEPRECATED_ATTRIBUTE
Deprecated:
Replaced by pointSizeAt:.
- (void) setParticleSize: (GLfloat)  aSize
at: (GLuint)  DEPRECATED_ATTRIBUTE 
Deprecated:
Replaced by setPointSize:at:.

Property Documentation

- (GLuint particleCount) DEPRECATED_ATTRIBUTE [read, write, assign]
Deprecated:
Use vertexCount instead.

Point particles have one vertex per particle.

Implements CC3Mesh.

- (CC3VertexContent) vertexContentTypes [read, write, assign]

Indicates the types of content contained in each vertex of this mesh.

Each vertex can contain several types of content, optionally including location, normal, color, and point size. To identify this various content, this property is a bitwise-OR of flags that enumerate the types of content contained in each vertex of this mesh.

Valid component flags of this property include:

  • kCC3VertexContentLocation
  • kCC3VertexContentNormal
  • kCC3VertexContentColor
  • kCC3VertexContentPointSize

To indicate that this mesh should contain particular vertex content, construct a bitwise-OR combination of one or more of the component types listed above, and set this property to that combined value.

Setting each bitwise-OR component in this property instructs this instance to automatically construct the appropriate type of contained vertex array:

  • kCC3VertexContentLocation - automatically constructs a CC3VertexLocations instance in the vertexLocations property, that holds 3D vertex locations, in one CC3Vector structure per vertex. This component is optional, as the vertexLocations property will be constructed regardless.
  • kCC3VertexContentNormal - automatically constructs a CC3VertexNormals instance in the vertexNormals property, that holds 3D vertex normals, in one CC3Vector structure per vertex.
  • kCC3VertexContentColor - automatically constructs a CC3VertexColors instance in the vertexColors property, that holds RGBA colors with GLubyte components, in one ccColor4B structure per vertex.
  • kCC3VertexContentPointSize - automatically constructs a CC3VertexPointSizes instance in the vertexPointSizes property, that holds one GLfloat per vertex.

This property is a convenience property. Instead of using this property, you can create the appropriate vertex arrays in those properties directly.

The vertex arrays constructed by this property will be configured to use interleaved data if the shouldInterleaveVertices property is set to YES. You should ensure the value of the shouldInterleaveVertices property to the desired value before setting the value of this property. The initial value of the shouldInterleaveVertices property is YES.

If the content is interleaved, for each vertex, the content is held in the structures identified in the list above, in the order that they appear in the list. You can use this consistent organization to create an enclosing structure to access all data for a single vertex, if it makes it easier to access vertex data that way. If vertex content is not specified, it is simply absent, and the content from the following type will be concatenated directly to the content from the previous type.

For instance, if color content is not required, you would omit the kCC3VertexContentColor value when setting this property, and the resulting structure for each vertex would be a location CC3Vector, followed by a normal CC3Vector, followed immediately by a point size GLfloat. You can then define an enclosing structure to hold and manage all content for a single vertex.

The vertex arrays created by this property cover the most common use cases and data formats. If you require more customized vertex arrays, you can use this property to create the typical vertex arrays, and then customize them, by accessing the vertex arrays individually through their respective properties. After doing so, if the vertex data is interleaved, you should invoke the updateVertexStride method on this instance to automatically align the elementOffset and vertexStride properties of all of the contained vertex arrays. After setting this property, you do not need to invoke the updateVertexStride method unless you subsequently make changes to the constructed vertex arrays.

It is safe to set this property more than once. Doing so will remove any existing vertex arrays and replace them with those indicated by this property.

When reading this property, the appropriate bitwise-OR values are returned, corresponding to the contained vertex arrays, even if those arrays were constructed directly, instead of by setting this property. If this mesh contains no vertex arrays, this property will return kCC3VertexContentNone.

Implements CC3VertexArrayMesh.

- (CC3VertexPointSizes *) vertexPointSizes [read, write, retain]

The vertex array instance managing a particle size datum for each particle.

Setting this property is optional. Many particle systems do not require individual sizing for each particle.


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