Particle Universe  1.2
ParticleUniverse::ParticleBehaviour Class Referenceabstract

#include <ParticleUniverseBehaviour.h>

Inheritance diagram for ParticleUniverse::ParticleBehaviour:

Public Member Functions

 ParticleBehaviour (void)
 
virtual ~ParticleBehaviour (void)
 
const StringgetBehaviourType (void) const
 
void setBehaviourType (const String &behaviourType)
 
ParticleTechniquegetParentTechnique (void) const
 
void setParentTechnique (ParticleTechnique *parentTechnique)
 
virtual void _notifyRescaled (const Vector3 &scale)
 
virtual void _prepare (ParticleTechnique *technique)
 
virtual void _unprepare (ParticleTechnique *particleTechnique)
 
virtual void _initParticleForEmission (Particle *particle)
 
virtual void _processParticle (ParticleTechnique *technique, Particle *particle, Real timeElapsed)=0
 
virtual void _initParticleForExpiration (ParticleTechnique *technique, Particle *particle, Real timeElapsed)
 
virtual void copyAttributesTo (ParticleBehaviour *behaviour)
 
virtual void copyParentAttributesTo (ParticleBehaviour *behaviour)
 
- Public Member Functions inherited from ParticleUniverse::IAlias
 IAlias (void)
 
virtual ~IAlias (void)
 
const StringgetAliasName (void) const
 
void setAliasName (String aliasName)
 
const AliasType getAliasType (void) const
 
void setAliasType (AliasType aliasType)
 
- Public Member Functions inherited from ParticleUniverse::IElement
 IElement (void)
 
virtual ~IElement (void)
 

Protected Attributes

String mBehaviourType
 
ParticleTechniquemParentTechnique
 
Vector3 _mBehaviourScale
 
- Protected Attributes inherited from ParticleUniverse::IAlias
String mAliasName
 
AliasType mAliasType
 

Additional Inherited Members

- Public Types inherited from ParticleUniverse::IAlias
enum  AliasType {
  AT_UNDEFINED, AT_TECHNIQUE, AT_RENDERER, AT_EMITTER,
  AT_AFFECTOR, AT_OBSERVER, AT_EXTERN, AT_HANDLER,
  AT_BEHAVIOUR
}
 

Detailed Description

Defines the behaviour of a particle.

Remarks
While a ParticleAffector acts as an external 'force' on the particles, the ParticleBehaviour defines the internal behaviour of each particle individually. For example, 'wind' is typically something that is defined as a ParticleAffector, while 'elasticity' is behaviour of the particle itself.
A particle can have multiple Behaviours. Each ParticleBehaviour is accompanied with a specific subclass of the ParticleBehaviourFactory. Similar to ParticleEmitters and ParticleAffectors, each factory is identified by means of a type name.
The main reason to introduce the ParticleBehaviour class is to be able to expand the attributes and functions of a particle dynamically and to assign behaviour by means of a particle script.

Constructor & Destructor Documentation

ParticleUniverse::ParticleBehaviour::ParticleBehaviour ( void  )
inline
virtual ParticleUniverse::ParticleBehaviour::~ParticleBehaviour ( void  )
inlinevirtual

Member Function Documentation

virtual void ParticleUniverse::ParticleBehaviour::_initParticleForEmission ( Particle particle)
inlinevirtual

Perform initialising activities as soon as the particle with which the ParticleBehaviour is associated, is emitted.

virtual void ParticleUniverse::ParticleBehaviour::_initParticleForExpiration ( ParticleTechnique technique,
Particle particle,
Real  timeElapsed 
)
inlinevirtual

Perform some action if a particle expires.

virtual void ParticleUniverse::ParticleBehaviour::_notifyRescaled ( const Vector3 scale)
inlinevirtual

Notify that the Behaviour is rescaled.

virtual void ParticleUniverse::ParticleBehaviour::_prepare ( ParticleTechnique technique)
inlinevirtual

Perform initialisation actions.

Remarks
The _prepare() function is automatically called during initialisation (prepare) activities of a ParticleTechnique. A subclass could implement this function to perform initialisation actions.
virtual void ParticleUniverse::ParticleBehaviour::_processParticle ( ParticleTechnique technique,
Particle particle,
Real  timeElapsed 
)
pure virtual

Process a particle.

Implemented in ParticleUniverse::SlaveBehaviour.

virtual void ParticleUniverse::ParticleBehaviour::_unprepare ( ParticleTechnique particleTechnique)
inlinevirtual

Reverse the actions from the _prepare.

virtual void ParticleUniverse::ParticleBehaviour::copyAttributesTo ( ParticleBehaviour behaviour)
inlinevirtual

Copy attributes to another ParticleBehaviour.

Reimplemented in ParticleUniverse::SlaveBehaviour.

virtual void ParticleUniverse::ParticleBehaviour::copyParentAttributesTo ( ParticleBehaviour behaviour)
inlinevirtual

Copy parent attributes to another behaviour.

const String& ParticleUniverse::ParticleBehaviour::getBehaviourType ( void  ) const
inline

Todo

ParticleTechnique* ParticleUniverse::ParticleBehaviour::getParentTechnique ( void  ) const
inline

Todo

void ParticleUniverse::ParticleBehaviour::setBehaviourType ( const String behaviourType)
inline
void ParticleUniverse::ParticleBehaviour::setParentTechnique ( ParticleTechnique parentTechnique)
inline

Member Data Documentation

Vector3 ParticleUniverse::ParticleBehaviour::_mBehaviourScale
protected

Although the scale is on a Particle System level, the behaviour can also be scaled.

String ParticleUniverse::ParticleBehaviour::mBehaviourType
protected
ParticleTechnique* ParticleUniverse::ParticleBehaviour::mParentTechnique
protected

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