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

#import <CC3MeshParticleSamples.h>

Inheritance diagram for CC3MultiTemplateMeshParticleEmitter:
Inheritance graph
[legend]

Instance Methods

(void) - addParticleTemplateMesh:
 
(void) - assignTemplateMeshToParticle:
 
(void) - removeParticleTemplateMesh:
 
- Instance Methods inherited from CC3MeshParticleEmitter
(id< CC3MeshParticleProtocol >) - acquireParticle
 
(id< CC3MeshParticleProtocol >) - emitParticle
 
(BOOL) - emitParticle:
 
(id< CC3MeshParticleProtocol >) - makeParticle
 
(void) - markParticleTransformDirty
 
(id< CC3MeshParticleProtocol >) - meshParticleAt:
 
(void) - setParticleTemplate:
 

Properties

NSArray * particleTemplateMeshes
 
- Properties inherited from CC3MeshParticleEmitter
BOOL isParticleTransformDirty
 
CC3MeshparticleTemplateMesh
 
BOOL shouldTransformUnseenParticles
 

Additional Inherited Members

- Class Methods inherited from CC3LocalContentNode
(ccColor4F) + localContentWireframeBoxColor
 
(void) + setLocalContentWireframeBoxColor:
 

Detailed Description

CC3MultiTemplateMeshParticleEmitter is a type of CC3MeshParticleEmitter that supports multiple particle template meshes, one of which can be selected and assigned to each particle as it is emitted.

Multiple particle templates can be added to this emitter using the addParticleTemplateMesh: method. The implementation of the assignTemplateMeshToParticle: method defines how a particular template mesh is selected by the emitter and assigned to a particle as it is being emitted.

For particles created by the application outside the emitter, and added to the emitter with the emitParticle: method, the application can directly set the templateMesh property of the mesh particle prior to invoking the emitParticle: method of this emitter. With this technique, each particle can use a different mesh template, and so each paticle can be a different shape. If the templateMesh property of a particle submitted to the emitParticle: method is nil, this emitter will select one of the particle templates that have been added to this emitter, and assign it to the particle.

For particles created within the emitter, and emitted automatically, or via the emitParticle method, this emitter will select one of the particle templates that have been added to this emitter, and assign it to the particle. In this scenario, each particle will be the same shape.

This class inherits the particleTemplateMesh property from CC3MeshParticleEmitter. If that property has also been set, mesh selection will be made from the set of meshes comprised of the template meshes added with the addParticleTemplateMesh: method, and the template mesh assigned to the particleTemplateMesh property.

Method Documentation

- (void) addParticleTemplateMesh: (CC3Mesh *)  aVtxArrayMesh

Adds the specified mesh to the collection of meshes in the particleTemplateMeshes property.

When a particle is emitted, or the emitParticle: method is invoked on a particle that does not already have templateMesh, one of these meshes is selected and assigned as the templateMesh of the particle before it is initialized. The particle template mesh is assigned by the assignTemplateMeshToParticle: method.

See the notes for the CC3MeshParticleProtocol templateMesh and CC3MeshParticleEmitter particleTemplateMesh for more information.

- (void) assignTemplateMeshToParticle: (id< CC3MeshParticleProtocol >)  aParticle

Template method that sets the templateMesh property of the specified particle.

This implementation sets the templateMesh property of the particle to a mesh randomly selected from the particleTemplateMeshes collection.

If the superclass particleTemplateMesh property of this emitter has also been set, it is included in the selection options, effectively increasing the selection options by one.

Subclasses may override this implementation to create some other selection methodology.

This method is invoked automatically when a particle is emitted, or the emitParticle: method is invoked with a particle that does not already have a templateMesh. The application should never need to invoke this method directly.

Implements CC3MeshParticleEmitter.

- (void) removeParticleTemplateMesh: (CC3Mesh *)  aVtxArrayMesh

Removes the specified mesh from the collection of meshes in the particleTemplateMeshes property.

Property Documentation

- (NSArray*) particleTemplateMeshes
readnonatomicretain

The collection of meshes that can be assigned as the templateMesh of each particle emitted from, or added to, this emitter.

When a particle is emitted automatically, of via the emitParticle method, or the emitParticle: method is invoked on a particle that does not already have templateMesh, one of these meshes is selected and assigned as the templateMesh of the particle before it is initialized. The particle template mesh is assigned by the assignTemplateMeshToParticle: method.

If the particleTemplateMesh property inherited from the CC3MeshParticleEmitter has also been set, mesh selection will be made from the set of meshes comprised of the combination of the mesh in the particleTemplateMesh property and the meshes in this collection.

See the notes for the CC3MeshParticleProtocol templateMesh and CC3MeshParticleEmitter particleTemplateMesh for more information.


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