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

#import <CC3Particles.h>

Inheritance diagram for CC3ParticleBase:
Inheritance graph
[legend]

Instance Methods

(id) - init
 
(void) - populateFrom:
 
(void) - remove
 

Class Methods

(id) + particle
 

Properties

CCColorRef color
 
ccColor4B color4B
 
ccColor4F color4F
 
CC3Vector globalLocation
 
BOOL hasColor
 
CC3Vector location
 
CCOpacity opacity
 

Detailed Description

CC3ParticleBase is a convenience class that forms a base implementation of the CC3ParticleProtocol protocol.

Method Documentation

- (id) init

Initializes this instance.

When initializing a particle, be aware that, in the interests of performance and memory conservation, expired particles can and will be cached and reused, and particle emission may not always involve instantiating a new instance of your particle class.

With this in mind, you should not depend on the init method being invoked during particle emission. All code that establishes the initial emitted state of a particle should be included in the initializeParticle method, or should be set in the initializeParticle: method of the particle emitter or particle navigator.

+ (id) particle

Allocates and initializes an autoreleased instance.

When initializing a particle, be aware that, in the interests of performance and memory conservation, expired particles can and will be cached and reused, and particle emission may not always involve instantiating a new instance of your particle class.

With this in mind, you should not depend on the init method being invoked during particle emission. All code that establishes the initial emitted state of a particle should be included in the initializeParticle method, or should be set in the initializeParticle: method of the particle emitter or particle navigator.

- (void) populateFrom: (CC3ParticleBase *)  another

Template method that populates this instance from the specified other instance.

This method is invoked automatically during object copying via the copy or copyWithZone: method. In most situations, the application should use the copy method, and should never need to invoke this method directly.

Subclasses that add additional instance state (instance variables) should extend copying by overriding this method to copy that additional state. Superclass that override this method should be sure to invoke the superclass implementation to ensure that superclass state is copied as well.

- (void) remove

Removes this particle from the emitter.

The differs from setting the isAlive property to NO, in that the removal is processed immediately, using the removeParticle: method of the emitter.

Property Documentation

- (CCColorRef) color
readwritenonatomicassign

The color of this particle.

If this particle has individual color content, (which can be checked with the hasColor property), this property indicates the color in which this particle will appear.

If this particle has individual color content, you can set this property at any time to define the color of the entire particle.

Particles are configured for individual color content by including the kCC3VertexContentColor component flag when setting the vertexContentTypes property of the emitter.

Setting this property will set the color of all vertices in the particle to the assigned color.

Reading this property returns the color value of the first vertex in the particle. If this particle does not support individual color content, this property will always return the value of the diffuseColor property of the emitter. In this condition, it is safe to set this property, but changes will have no effect.

- (ccColor4B) color4B
readwritenonatomicassign

If this particle has individual color content, (which can be checked with the hasColor property), this property indicates the color in which this particle will appear.

If this particle has individual color content, you can set this property at any time to define the color of the entire particle.

Particles are configured for individual color content by including the kCC3VertexContentColor component flag when setting the vertexContentTypes property of the emitter.

Setting this property will set the color of all vertices in the particle to the assigned color.

Reading this property returns the color value of the first vertex in the particle. If this particle does not support individual color content, this property will always return the value of the diffuseColor property of the emitter. In this condition, it is safe to set this property, but changes will have no effect.

- (ccColor4F) color4F
readwritenonatomicassign

If this particle has individual color content, (which can be checked with the hasColor property), this property indicates the color in which this particle will appear.

If this particle has individual color content, you can set this property at any time to define the color of the entire particle.

Particles are configured for individual color content by including the kCC3VertexContentColor component flag when setting the vertexContentTypes property of the emitter.

Setting this property will set the color of all vertices in the particle to the assigned color.

Reading this property returns the color value of the first vertex in the particle. If this particle does not support individual color content, this property will always return the value of the diffuseColor property of the emitter. In this condition, it is safe to set this property, but changes will have no effect.

- (CC3Vector) globalLocation
readnonatomicassign

The location of the particle in 3D space, relative to the global origin.

This is calculated by using the globalTransformMatrix of the emitter to transform the location of this particle.

- (BOOL) hasColor
readnonatomicassign

Indicates whether this particle has individual color content.

This is determine by the configuration of the emitter. Within an emitter, either all particles have this content, or none do.

When this property returns YES, each particle can be set to a different color. When this property returns NO, all particles will have the color specified by the diffuseColor property of the emitter.

Particles are configured for individual color content by including the kCC3VertexContentColor component flag when setting the vertexContentTypes property of the emitter.

- (CC3Vector) location
readwritenonatomicassign

The location of this particle in the local coordinate system of the emitter.

You can set this property in the initializeParticle and updateBeforeTransform: methods to move the particle around.

The initial value of this property, set prior to the invocation of the initializeParticle method, is kCC3VectorZero.

- (CCOpacity) opacity
readwritenonatomicassign

The opacity of this particle.

If this particle has individual color content, (which can be checked with the hasColor property), this property indicates the opacity in which this particle will appear.

If this particle has individual color content, you can set this property at any time to define the opacity of the entire particle.

Particles are configured for individual color content by including the kCC3VertexContentColor component flag when setting the vertexContentTypes property of the emitter.

Setting this property will set the opacity of all vertices in the particle to the assigned value.

Reading this property returns the color value of the first vertex in the particle. If this particle does not support individual color content, this property will always return the value of the opacity of the diffuseColor property of the emitter. In this condition, it is safe to set this property, but changes will have no effect.


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