v2.0.2
Instance Methods | Properties | List of all members
<CC3PointParticleProtocol> Protocol Reference

#import <CC3PointParticles.h>

Inheritance diagram for <CC3PointParticleProtocol>:
Inheritance graph
[legend]

Instance Methods

(void) - pointNormalAt:
 

Properties

GLuint particleIndex
 
- Properties inherited from <CC3CommonVertexArrayParticleProtocol>
BOOL hasVertexIndices
 
GLuint vertexCount
 
GLuint vertexIndexCount
 
NSRange vertexIndexRange
 
NSRange vertexRange
 

Detailed Description

CC3PointParticleProtocol defines the requirements for point particles that are emitted and managed by the CC3PointParticleEmitter class.

Relative to mesh particles, point particles are extremely efficient and performance-friendly, since they comprise only a single vertex per particle, and do not need to be transformed. However, they are limited in that they can comprise only a single rectangular 2D texture.

Point particles can be located, colored, and textured. Point particles cannot be rotated or given a 3D appearance. Point particles do not support a texture rectangle, and so all particles from a single emitter must be textured identically.

Method Documentation

- (void) pointNormalAt: (CC3Vector camLoc

Invoked automatically, if the particle has vertex normal content, to point the normal vector of the particle at the specified location, which is expressed in terms of the local coordinate system of the emitter.

To point the particle itself at the location, we use vector math. The vector from the emitter to the particle is subtracted from the vector from the emitter to the specified location. The result is a vector that points from the particle to the given location. This vector is normalized and set in the normal property.

This method is invoked automatically by the emitter if the particle has a normal, and the shouldUseLighting property of the emitter is set to YES, to keep the normal of the particle pointed towards the camera, so that the particle will appear to interact with the scene lighting.

Property Documentation

- (GLuint) particleIndex
readwritenonatomicassign

The index of this particle within the collection of particles managed by the emitter.

You should not assume that this property will be consistent during the lifetime of the particle. It can and will change spontaneously as other particles expire and the emitter manages its collection of particles.

This property is set by the particle emitter as it manages its collection of particles. The application must treat this property as read-only, and must never set this property directly.

At any time, this value is unique across all current living particles managed by the emitter.


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