Public Member Functions | Protected Attributes

CC3MortalPointParticle Class Reference

CC3MortalPointParticle is a point particle implementation of the CC3MortalParticleProtocol that has a finite life. More...

#import <CC3PointParticleSamples.h>

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

List of all members.

Public Member Functions

(void) - updateBeforeTransform:
(void) - updateLife:

Protected Attributes

ccTime lifeSpan
ccTime timeToLive

Detailed Description

CC3MortalPointParticle is a point particle implementation of the CC3MortalParticleProtocol that has a finite life.

To make evolutionary changes to this particle, implement the updateBeforeTransform: method. In doing so, be sure to invoke the superclass implementation, which checks whether this particle is still alive or has expired. Once the superclass implementation returns, you can check the isAlive property before spending time making any further modifications.


Member Function Documentation

- (void) updateBeforeTransform: (CC3NodeUpdatingVisitor *)  visitor

This template callback method is invoked automatically whenever the emitter is updated during a scheduled 3D scene update.

The CC3MortalPointParticle implementation checks to see if the whether this particle is still alive or has expired, and sets the isAlive property accordingly.

You can override this method to update the evolution of the particle. You should invoke this superclass implementation and test the isAlive property before making any further modifications.

Subclasses that override this method should invoke this superclass implementation first, and should check the isAlive property prior to making any further modifications..

Implemented in CC3SprayPointParticle.

- (void) updateLife: (ccTime)  DEPRECATED_ATTRIBUTE
Deprecated:
Override the updateBeforeTransform: method, invoke the superclass implementation, and then test the isAlive property of this particle before any further modifications.

Member Data Documentation

- (ccTime) lifeSpan [protected]

Indicates the overall life span of the particle.

This property should be set once during initialization, prior to emission.

Reimplemented from <CC3MortalParticleProtocol>.

- (ccTime) timeToLive [protected]

Indicates the remaining time the particle has to live.

This property is automatically decremented as the particle ages. Once this property reaches zero, the particle will automatically expire itself.

Reimplemented from <CC3MortalParticleProtocol>.


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