Particle Universe  1.2
ParticleUniverse::ParticleTechnique Class Reference

#include <ParticleUniverseTechnique.h>

Inheritance diagram for ParticleUniverse::ParticleTechnique:

Classes

struct  DirectionSorter
 
struct  DistanceSorter
 

Public Types

typedef vector< ParticleEmitter * > ParticleEmitterList
 
typedef ParticleEmitterList::const_iterator ParticleEmitterIterator
 
typedef vector< ParticleAffector * > ParticleAffectorList
 
typedef ParticleAffectorList::const_iterator ParticleAffectorIterator
 
typedef vector< ParticleObserver * > ParticleObserverList
 
typedef ParticleObserverList::const_iterator ParticleObserverIterator
 
typedef vector< Extern * > ExternList
 
typedef ExternList::const_iterator ExternIterator
 
typedef vector< TechniqueListener * > TechniqueListenerList
 
typedef TechniqueListenerList::const_iterator TechniqueListenerIterator
 
- Public Types inherited from ParticleUniverse::Particle
enum  ParticleType {
  PT_VISUAL, PT_TECHNIQUE, PT_EMITTER, PT_AFFECTOR,
  PT_SYSTEM
}
 
enum  ReservedParticleEventFlags { PEF_EXPIRED = 1<<0, PEF_EMITTED = 1<<1, PEF_COLLIDED = 1<<2 }
 
typedef vector< ParticleBehaviour * > ParticleBehaviourList
 
typedef ParticleBehaviourList::const_iterator ParticleBehaviourIterator
 
- 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
}
 

Public Member Functions

 ParticleTechnique (void)
 
virtual ~ParticleTechnique (void)
 
ParticleSystemgetParentSystem (void) const
 
void setParentSystem (ParticleSystem *parentSystem)
 
const StringgetName (void) const
 
void setName (const String &name)
 
size_t getVisualParticleQuota (void) const
 
void setVisualParticleQuota (size_t quota)
 
size_t getEmittedEmitterQuota (void) const
 
void setEmittedEmitterQuota (size_t quota)
 
size_t getEmittedTechniqueQuota (void) const
 
void setEmittedTechniqueQuota (size_t quota)
 
size_t getEmittedAffectorQuota (void) const
 
void setEmittedAffectorQuota (size_t quota)
 
size_t getEmittedSystemQuota (void) const
 
void setEmittedSystemQuota (size_t quota)
 
const Real getDefaultWidth (void) const
 
void setDefaultWidth (const Real width)
 
const Real getDefaultHeight (void) const
 
void setDefaultHeight (const Real height)
 
const Real getDefaultDepth (void) const
 
void setDefaultDepth (const Real depth)
 
const Vector3getDerivedPosition (void)
 
Real getCameraSquareDistance (void) const
 
void setCameraSquareDistance (Real cameraSquareDistance)
 
void suppressNotifyEmissionChange (bool suppress)
 
const StringgetMaterialName (void) const
 
const Ogre::MaterialPtr getMaterial (void) const
 
void setMaterialName (const String &materialName)
 
ParticleEmittercreateEmitter (const String &emitterType)
 
void addEmitter (ParticleEmitter *emitter)
 
void removeEmitter (ParticleEmitter *emitter)
 
ParticleEmittergetEmitter (size_t index) const
 
ParticleEmittergetEmitter (const String &emitterName) const
 
size_t getNumEmitters (void) const
 
void destroyEmitter (size_t index)
 
void destroyEmitter (ParticleEmitter *emitter)
 
void destroyAllEmitters (void)
 
size_t getNumEmittedEmitters (void) const
 
ParticleAffectorcreateAffector (const String &affectorType)
 
void addAffector (ParticleAffector *affector)
 
void removeAffector (ParticleAffector *affector)
 
ParticleAffectorgetAffector (size_t index) const
 
ParticleAffectorgetAffector (const String &affectorName) const
 
size_t getNumAffectors (void) const
 
void destroyAffector (size_t index)
 
void destroyAffector (ParticleAffector *affector)
 
void destroyAllAffectors (void)
 
size_t getNumEmittedAffectors (void) const
 
ParticleObservercreateObserver (const String &observerType)
 
void addObserver (ParticleObserver *observer)
 
void removeObserver (ParticleObserver *observer)
 
ParticleObservergetObserver (size_t index) const
 
ParticleObservergetObserver (const String &observerName) const
 
size_t getNumObservers (void) const
 
void destroyObserver (size_t index)
 
void destroyObserver (ParticleObserver *observer)
 
void destroyAllObservers (void)
 
ParticleRenderergetRenderer (void) const
 
void setRenderer (const String &rendererType)
 
void removeRenderer (ParticleRenderer *renderer)
 
void setRenderer (ParticleRenderer *renderer)
 
void destroyRenderer (void)
 
void _addBehaviourTemplate (ParticleBehaviour *behaviourTemplate)
 
void _removeBehaviourTemplate (ParticleBehaviour *behaviourTemplate)
 
ParticleBehaviour_getBehaviourTemplate (size_t index) const
 
ParticleBehaviour_getBehaviourTemplate (const String &behaviourType) const
 
size_t _getNumBehaviourTemplates (void) const
 
void _destroyBehaviourTemplate (ParticleBehaviour *behaviourTemplate)
 
void _destroyAllBehaviourTemplates (void)
 
ExterncreateExtern (const String &externType)
 
void addExtern (Extern *externObject)
 
void removeExtern (Extern *externObject)
 
ExterngetExtern (size_t index) const
 
ExterngetExtern (const String &externName) const
 
ExterngetExternType (const String &externType) const
 
size_t getNumExterns (void) const
 
void destroyExtern (size_t index)
 
void destroyExtern (Extern *externObject)
 
void destroyAllExterns (void)
 
void _updateRenderQueue (Ogre::RenderQueue *queue)
 
void setRenderQueueGroup (uint8 queueId)
 
void _prepare (void)
 
void _unprepare (void)
 
void _prepareSystem (void)
 
void _unprepareSystem (void)
 
void _prepareTechnique (void)
 
void _unprepareTechnique (void)
 
void _prepareVisualParticles (void)
 
void _unprepareVisualParticles (void)
 
void _prepareRenderer (void)
 
void _unprepareRenderer (void)
 
void _prepareEmitters (void)
 
void _unprepareEmitters (void)
 
void _prepareAffectors (void)
 
void _unprepareAffectors (void)
 
void _prepareBehaviours (void)
 
void _unprepareBehaviours (void)
 
void _prepareExterns (void)
 
void _unprepareExterns (void)
 
void _update (Real timeElapsed)
 
void _notifyEmissionChange (void)
 
void _notifyAttached (Ogre::Node *parent, bool isTagPoint=false)
 
void _notifyAttachedPooledTechniques (Ogre::Node *parent, bool isTagPoint)
 
void _notifyCurrentCamera (Camera *camera)
 
void _notifyCurrentCameraPooledTechniques (Camera *camera)
 
void _notifyParticleResized (void)
 
void _notifyStart (void)
 
void _notifyStop (void)
 
bool isStopFade (void)
 
void _notifyPause (void)
 
void _notifyResume (void)
 
bool _isExpired (Particle *particle, Real timeElapsed)
 
void forceEmission (ParticleEmitter *emitter, unsigned requested)
 
void forceEmission (const Particle::ParticleType particleType, unsigned requested)
 
virtual void copyAttributesTo (ParticleTechnique *technique)
 
unsigned short getLodIndex (void) const
 
void setLodIndex (unsigned short lodIndex)
 
void _markForEmission (void)
 
void _markForEmission (ParticleEmitter *emitter, bool mark=true)
 
void _notifyUpdateBounds (void)
 
void _resetBounds (void)
 
void _notifyRescaled (const Vector3 &scale)
 
void _notifyVelocityRescaled (const Real &scaleVelocity)
 
const AxisAlignedBoxgetWorldBoundingBox (void) const
 
void _sortVisualParticles (Camera *camera)
 
void setWidthCameraDependency (CameraDependency *cameraDependency)
 
void setWidthCameraDependency (Real squareDistance, bool inc)
 
CameraDependencygetWidthCameraDependency (void) const
 
void setHeightCameraDependency (CameraDependency *cameraDependency)
 
void setHeightCameraDependency (Real squareDistance, bool inc)
 
CameraDependencygetHeightCameraDependency (void) const
 
void setDepthCameraDependency (CameraDependency *cameraDependency)
 
void setDepthCameraDependency (Real squareDistance, bool inc)
 
CameraDependencygetDepthCameraDependency (void) const
 
size_t getNumberOfEmittedParticles (void)
 
size_t getNumberOfEmittedParticles (Particle::ParticleType particleType)
 
void _initAllParticlesForExpiration (void)
 
void lockAllParticles (void)
 
void initVisualDataInPool (void)
 
ParticlePool_getParticlePool (void)
 
bool isKeepLocal (void) const
 
void setKeepLocal (bool keepLocal)
 
bool makeParticleLocal (Particle *particle)
 
SpatialHashTable< Particle * > * getSpatialHashTable (void) const
 
bool isSpatialHashingUsed (void) const
 
void setSpatialHashingUsed (bool spatialHashingUsed)
 
unsigned short getSpatialHashingCellDimension (void) const
 
void setSpatialHashingCellDimension (unsigned short spatialHashingCellDimension)
 
unsigned short getSpatialHashingCellOverlap (void) const
 
void setSpatialHashingCellOverlap (unsigned short spatialHashingCellOverlap)
 
unsigned int getSpatialHashTableSize (void) const
 
void setSpatialHashTableSize (unsigned int spatialHashTableSize)
 
Real getSpatialHashingInterval (void) const
 
void setSpatialHashingInterval (Real spatialHashingInterval)
 
bool isSpatialHashingParticleSizeUsed (void) const
 
void setSpatialHashingParticleSizeUsed (bool spatialHashingParticleSizeUsed)
 
Real getMaxVelocity (void) const
 
void setMaxVelocity (Real maxVelocity)
 
void addTechniqueListener (TechniqueListener *techniqueListener)
 
void removeTechniqueListener (TechniqueListener *techniqueListener)
 
void logDebug (void)
 
Real getParticleSystemScaleVelocity (void) const
 
void pushEvent (ParticleUniverseEvent &particleUniverseEvent)
 
- Public Member Functions inherited from ParticleUniverse::Particle
 Particle (void)
 
virtual ~Particle (void)
 
bool _isMarkedForEmission (void) const
 
void _setMarkedForEmission (bool markedForEmission)
 
virtual bool isEnabled (void) const
 
virtual void setEnabled (bool enabled)
 
void _setOriginalEnabled (bool originalEnabled)
 
bool _getOriginalEnabled (void) const
 
bool isFreezed (void) const
 
void setFreezed (bool freezed)
 
void setEventFlags (uint32 flags)
 
void addEventFlags (uint32 flags)
 
void removeEventFlags (uint32 flags)
 
uint32 getEventFlags (void) const
 
bool hasEventFlags (uint32 flags) const
 
void copyBehaviours (ParticleBehaviourList &behaviours)
 
virtual void _process (ParticleTechnique *technique, Real timeElapsed)
 
ParticleBehaviourgetBehaviour (const String &behaviourType)
 
Real calculateVelocity (void) const
 
virtual void copyAttributesTo (Particle *particle)
 
- 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)
 

Static Public Attributes

static const bool DEFAULT_ENABLED
 
static const Vector3 DEFAULT_POSITION
 
static const bool DEFAULT_KEEP_LOCAL
 
static const size_t DEFAULT_VISUAL_PARTICLE_QUOTA
 
static const size_t DEFAULT_EMITTED_EMITTER_QUOTA
 
static const size_t DEFAULT_EMITTED_TECHNIQUE_QUOTA
 
static const size_t DEFAULT_EMITTED_AFFECTOR_QUOTA
 
static const size_t DEFAULT_EMITTED_SYSTEM_QUOTA
 
static const unsigned short DEFAULT_LOD_INDEX
 
static const Real DEFAULT_WIDTH
 
static const Real DEFAULT_HEIGHT
 
static const Real DEFAULT_DEPTH
 
static const unsigned short DEFAULT_SPATIAL_HASHING_CELL_DIM
 
static const unsigned short DEFAULT_SPATIAL_HASHING_CELL_OVERLAP
 
static const size_t DEFAULT_SPATIAL_HASHING_TABLE_SIZE
 
static const Real DEFAULT_SPATIAL_HASHING_INTERVAL
 
static const Real DEFAULT_MAX_VELOCITY
 
- Static Public Attributes inherited from ParticleUniverse::Particle
static Real DEFAULT_TTL
 
static Real DEFAULT_MASS
 

Protected Member Functions

void _pushTechniqueEvent (EventType eventType)
 
void _initParticleForEmission (Particle *particle)
 
virtual void _initForEmission (void)
 
virtual void _initForExpiration (ParticleTechnique *technique, Real timeElapsed)
 
void _updateRenderQueuePooledTechniques (Ogre::RenderQueue *queue)
 
void _resetMarkForEmission (void)
 
void _processParticles (Real timeElapsed)
 
void _processDependencies (void)
 
void _extractPooledAffectors (void)
 
void _processSpatialHashing (Particle *particle, Real timeElapsed)
 
void _processAffectors (Particle *particle, Real timeElapsed, bool firstParticle)
 
void _preProcessParticles (Real timeElapsed)
 
void _postProcessParticles (Real timeElapsed)
 
void _postProcessSpatialHashing (void)
 
void _processExternals (Particle *particle, Real timeElapsed, bool firstParticle)
 
void _processRenderer (Particle *particle, Real timeElapsed, bool firstParticle)
 
void _processParticleSelf (Particle *particle, Real timeElapsed, bool firstParticle)
 
void _initParticleForExpiration (Particle *particle, Real timeElapsed)
 
void _processObservers (Particle *particle, Real timeElapsed, bool firstParticle)
 
void _emitParticles (Real timeElapsed)
 
void _executeEmitParticles (ParticleEmitter *emitter, unsigned requested, Real timeElapsed)
 
void _processMotion (Particle *particle, Real timeElapsed, bool firstParticle)
 
void _notifyStartPooledComponents (void)
 
void _notifyStopPooledComponents (void)
 
void _notifyPausePooledComponents (void)
 
void _notifyResumePooledComponents (void)
 

Protected Attributes

ParticleSystemmParentSystem
 
String mName
 
bool mVisualParticlePoolIncreased
 
bool mParticleEmitterPoolIncreased
 
bool mParticleTechniquePoolIncreased
 
bool mParticleAffectorPoolIncreased
 
bool mParticleSystemPoolIncreased
 
size_t mVisualParticleQuota
 
size_t mEmittedEmitterQuota
 
size_t mEmittedTechniqueQuota
 
size_t mEmittedAffectorQuota
 
size_t mEmittedSystemQuota
 
ParticleEmitterList mEmitters
 
ParticleAffectorList mAffectors
 
ParticleObserverList mObservers
 
Particle::ParticleBehaviourList mBehaviourTemplates
 
ExternList mExterns
 
ParticlePool mPool
 
ParticleAffectorList mCopyOfPooledAffectors
 
ParticleRenderermRenderer
 
bool mSuppressNotifyEmissionChange
 
String mMaterialName
 
Real mDefaultWidth
 
Real mDefaultHeight
 
Real mDefaultDepth
 
unsigned short mLodIndex
 
Real mCameraSquareDistance
 
CameraDependencymWidthCameraDependency
 
CameraDependencymHeightCameraDependency
 
CameraDependencymDepthCameraDependency
 
CameraDependencyFactory mCameraDependencyFactory
 
bool mPrepareExtern
 
bool mPrepareBehaviour
 
bool mPrepareAffector
 
bool mPrepareEmitter
 
AxisAlignedBox mWorldAABB
 
bool mUpdateWorldAABB
 
Vector3 mMinWorldExtend
 
Vector3 mMaxWorldExtend
 
bool mHasExtents
 
bool mKeepLocal
 
Vector3 _mParticleSystemScale
 
Real _mParticleSystemScaleVelocity
 
bool mIsSpatialHashingUsed
 
bool mIsSpatialHashingInitialised
 
unsigned short mSpatialHashingCellDimension
 
unsigned short mSpatialHashingCellOverlap
 
unsigned int mSpatialHashTableSize
 
SpatialHashTable< Particle * > * mSpatialHashTableA
 
SpatialHashTable< Particle * > * mSpatialHashTableB
 
SpatialHashTable< Particle * > * mCurrentSpatialHashTable
 
Real mSpatialHashingInterval
 
Real mSpatialHashingIntervalRemainder
 
bool mSpatialHashingIntervalSet
 
bool mSpatialHashingIntervalActivate
 
Real mMaxVelocity
 
bool mMaxVelocitySet
 
TechniqueListenerList mTechniqueListenerList
 
size_t mMaxNumVisualParticles
 
size_t mMaxNumEmitterParticles
 
size_t mMaxNumTechniqueParticles
 
size_t mMaxNumAffectorParticles
 
size_t mMaxNumSystemParticles
 
- Protected Attributes inherited from ParticleUniverse::Particle
uint32 mEventFlags
 
bool mMarkedForEmission
 
bool mEnabled
 
bool mFreezed
 
bool mOriginalEnabled
 
bool mOriginalEnabledSet
 
Vector3 mDerivedPosition
 
ParticleBehaviourList mBehaviours
 
- Protected Attributes inherited from ParticleUniverse::IAlias
String mAliasName
 
AliasType mAliasType
 

Static Protected Attributes

static RadixSort< Pool< VisualParticle >::PoolList, Particle *, float > mRadixSorter
 

Additional Inherited Members

- Public Attributes inherited from ParticleUniverse::Particle
ParticleEmitterparentEmitter
 
Vector3 position
 
Vector3 direction
 
Real mass
 
Real timeToLive
 
Real totalTimeToLive
 
Real timeFraction
 
ParticleType particleType
 
Any mUserDefinedObject
 
PhysicsActorphysicsActor
 
IVisualDatavisualData
 
Vector3 originalPosition
 
Vector3 originalDirection
 
Real originalVelocity
 
Real originalDirectionLength
 
Real originalScaledDirectionLength
 
Vector3 latestPosition
 

Detailed Description

In analogy of Ogre's material system, the ParticleTechnique is introduced. It forms an extra layer between particle emitters, affectors, etc. on one side, and the particle system and the other side. A ParticleTechnique has a few benefits. For example, with the use of a ParticleTechnique it is possible to implement Particle LOD (Level Of Detail). Also combining multiple renderers and material within one ParticleSystem is possible.

Member Typedef Documentation

typedef ExternList::const_iterator ParticleUniverse::ParticleTechnique::ExternIterator
typedef ParticleAffectorList::const_iterator ParticleUniverse::ParticleTechnique::ParticleAffectorIterator
typedef ParticleEmitterList::const_iterator ParticleUniverse::ParticleTechnique::ParticleEmitterIterator
typedef ParticleObserverList::const_iterator ParticleUniverse::ParticleTechnique::ParticleObserverIterator
typedef TechniqueListenerList::const_iterator ParticleUniverse::ParticleTechnique::TechniqueListenerIterator

Constructor & Destructor Documentation

ParticleUniverse::ParticleTechnique::ParticleTechnique ( void  )
virtual ParticleUniverse::ParticleTechnique::~ParticleTechnique ( void  )
virtual

Member Function Documentation

void ParticleUniverse::ParticleTechnique::_addBehaviourTemplate ( ParticleBehaviour behaviourTemplate)

Add a ParticleBehaviour template to this ParticleTechnique.

Remarks
The ParticleBehaviour only serves as a blueprint for other ParticleBehaviour objects that are attached to a Particle, so the method should only be used internally.
Parameters
Pointerto a previously created Behaviour object.
void ParticleUniverse::ParticleTechnique::_destroyAllBehaviourTemplates ( void  )

Delete all ParticleBehaviour templates of this ParticleTechnique.

void ParticleUniverse::ParticleTechnique::_destroyBehaviourTemplate ( ParticleBehaviour behaviourTemplate)

Delete a ParticleBehaviour template that is part of this ParticleTechnique.

void ParticleUniverse::ParticleTechnique::_emitParticles ( Real  timeElapsed)
protected

Call the emitters to emit particles.

void ParticleUniverse::ParticleTechnique::_executeEmitParticles ( ParticleEmitter emitter,
unsigned  requested,
Real  timeElapsed 
)
protected

Actually executes emission of particles.

void ParticleUniverse::ParticleTechnique::_extractPooledAffectors ( void  )
protected

Copies the pooled affectors from the pool to a separate list.

Remarks
Unfortunately, the particle pool can only be iterated once at a time. This prevents simultanious iteration of both particles and affectors, so the pooled affectors are stored in a temporary list. The benefit of a separate affector list is that it allows fast traversing once it has been created.
ParticleBehaviour* ParticleUniverse::ParticleTechnique::_getBehaviourTemplate ( size_t  index) const

Get a ParticleBehaviour template. Search by index.

ParticleBehaviour* ParticleUniverse::ParticleTechnique::_getBehaviourTemplate ( const String behaviourType) const

Get a ParticleBehaviour template. Search by type.

size_t ParticleUniverse::ParticleTechnique::_getNumBehaviourTemplates ( void  ) const

Get the number of ParticleBehaviour templates added to this ParticleTechnique.

ParticlePool* ParticleUniverse::ParticleTechnique::_getParticlePool ( void  )

Returns a pointer to the particle pool.

Remarks
Caution: Only use this function if you know what you are doing. If this function is called from a function that is already iterating over the pool, unexpected behaviour can occur.
void ParticleUniverse::ParticleTechnique::_initAllParticlesForExpiration ( void  )

Expire all active (emitted) particles and put them back into the pool.

virtual void ParticleUniverse::ParticleTechnique::_initForEmission ( void  )
protectedvirtual

Initialise the ParticleTechnique before it is emitted itself.

Reimplemented from ParticleUniverse::Particle.

virtual void ParticleUniverse::ParticleTechnique::_initForExpiration ( ParticleTechnique technique,
Real  timeElapsed 
)
protectedvirtual

Initialise the ParticleTechnique before it is expired itself.

Reimplemented from ParticleUniverse::Particle.

void ParticleUniverse::ParticleTechnique::_initParticleForEmission ( Particle particle)
protected

Initialises a particle by another object (if available).

void ParticleUniverse::ParticleTechnique::_initParticleForExpiration ( Particle particle,
Real  timeElapsed 
)
protected

Perform actions if a particle gets expired.

bool ParticleUniverse::ParticleTechnique::_isExpired ( Particle particle,
Real  timeElapsed 
)
inline

Validate whether a particle is expired.

void ParticleUniverse::ParticleTechnique::_markForEmission ( void  )

Determine which techniques, affectors, emitters will be emitted.

Remarks
All objects that are able to be emitted will get an indication when they are emitted. This function runs through all ParticleEmitters and if the ParticleEmitter emits objects other than visual particles, these objects are marked.
void ParticleUniverse::ParticleTechnique::_markForEmission ( ParticleEmitter emitter,
bool  mark = true 
)

Determines which techniques, affectors, emitters will be emitted (or not) by the given emitter.

void ParticleUniverse::ParticleTechnique::_notifyAttached ( Ogre::Node parent,
bool  isTagPoint = false 
)

Implementation of the _notifyAttached, needed for each technique that is part of a particle system.

Remarks
Delegates to the renderer.
void ParticleUniverse::ParticleTechnique::_notifyAttachedPooledTechniques ( Ogre::Node parent,
bool  isTagPoint 
)

Notify the pooled techniques that its parent system has been attached or detached.

Remarks
This is done for emitted ParticleTechniques.
void ParticleUniverse::ParticleTechnique::_notifyCurrentCamera ( Camera camera)

Implementation of the _notifyCurrentCamera, needed for each technique that is part of a particle system.

Remarks
Delegates to the renderer.
void ParticleUniverse::ParticleTechnique::_notifyCurrentCameraPooledTechniques ( Camera camera)

Notify the pooled techniques with the current camera.

Remarks
This is done for emitted ParticleTechniques.
void ParticleUniverse::ParticleTechnique::_notifyEmissionChange ( void  )

Is called as soon as a new emitter is added or deleted, which leads to a re-evaluation of the emitted objects.

Remarks
Emitters are able to emit other objects (emitters, techniques, affectors) besides visual particles, and removing or adding an emitter could lead to a broken chain of references. This means that 1). Emitters that were emitted by a deleted emitter, aren't emitted anymore. 2). An added emitter could emit another emitter (or affector); the other emitter has to know that it will be emitted. 3). Another emitter could emit the emitter that is added; the added emitter has to know that. 4). If an already existing emitter sets its emitsName the chain is broken.
This method runs through the whole chain of emitters each time a new emitter is added or an emitter is deleted. This has a performance penalty, but since the number of emitters is usually not very large we can get away with it.
If an emitter is deleted and this emitter is also emitted itself, the effect of deletion is not always instantly noticable. Emitted emitters are part of the particle pool and are NOT deleted if the base emitter (from which the pooled emitters are cloned) is deleted.
void ParticleUniverse::ParticleTechnique::_notifyParticleResized ( void  )

Implementation of the _notifyParticleResized, needed for each technique that is part of a particle system.

Remarks
Delegates to the renderer.
void ParticleUniverse::ParticleTechnique::_notifyPause ( void  )

Perform activities when a ParticleTechnique is paused.

void ParticleUniverse::ParticleTechnique::_notifyPausePooledComponents ( void  )
protected

Similar as _notifyPause(), but now for the pooled components.

void ParticleUniverse::ParticleTechnique::_notifyRescaled ( const Vector3 scale)

Notify that the Particle System is rescaled.

void ParticleUniverse::ParticleTechnique::_notifyResume ( void  )

Perform activities when a ParticleTechnique is resumed.

void ParticleUniverse::ParticleTechnique::_notifyResumePooledComponents ( void  )
protected

Similar as _notifyResume(), but now for the pooled components.

void ParticleUniverse::ParticleTechnique::_notifyStart ( void  )

Perform activities when a ParticleTechnique is started.

Remarks
This is only used to set some attributes to their default value, so a re-start can be performed. Note, that one cannot assume that the _prepare() function has been called, so donŽt perform initialisation activities on objects that are not created yet (for instance the renderer).
void ParticleUniverse::ParticleTechnique::_notifyStartPooledComponents ( void  )
protected

Similar as _notifyStart(), but now for the pooled components.

void ParticleUniverse::ParticleTechnique::_notifyStop ( void  )

Perform activities when a ParticleTechnique is stopped.

void ParticleUniverse::ParticleTechnique::_notifyStopPooledComponents ( void  )
protected

Similar as _notifyStop(), but now for the pooled components.

void ParticleUniverse::ParticleTechnique::_notifyUpdateBounds ( void  )

Notify updating the axis aligned bounding box.

Remarks
The Particle System calls this function to make the ParticleTechnique calculating its mWorldAABB.
void ParticleUniverse::ParticleTechnique::_notifyVelocityRescaled ( const Real scaleVelocity)

Notify that the velocity is rescaled.

void ParticleUniverse::ParticleTechnique::_postProcessParticles ( Real  timeElapsed)
protected

Perform some activities after all individual particles are processed.

void ParticleUniverse::ParticleTechnique::_postProcessSpatialHashing ( void  )
protected

A Spatial Hash table is used if particles approach each other and the mutual distance is important. This function is called for each particle if the use of a Spatial Hash table is set to true.

void ParticleUniverse::ParticleTechnique::_prepare ( void  )

Perform some initialisation activities.

Remarks
To reduce initialisation activities as soon as the particle system is started, these activities can also be performed in front.
void ParticleUniverse::ParticleTechnique::_prepareAffectors ( void  )

Perform (un)initialisation activities of affectors.

void ParticleUniverse::ParticleTechnique::_prepareBehaviours ( void  )

Perform (un)initialisation activities of behaviours.

void ParticleUniverse::ParticleTechnique::_prepareEmitters ( void  )

Perform (un)initialisation activities of emitters.

void ParticleUniverse::ParticleTechnique::_prepareExterns ( void  )

Perform (un)initialisation activities of externs.

void ParticleUniverse::ParticleTechnique::_prepareRenderer ( void  )

Perform (un)initialisation activities of the renderer.

void ParticleUniverse::ParticleTechnique::_prepareSystem ( void  )

Perform (un)initialisation activities of system elements.

void ParticleUniverse::ParticleTechnique::_prepareTechnique ( void  )

Perform (un)initialisation activities of the technique itself.

void ParticleUniverse::ParticleTechnique::_prepareVisualParticles ( void  )

(Un)initialise visual particles if needed.

void ParticleUniverse::ParticleTechnique::_preProcessParticles ( Real  timeElapsed)
protected

Perform some activities before all individual particles are processed.

void ParticleUniverse::ParticleTechnique::_processAffectors ( Particle particle,
Real  timeElapsed,
bool  firstParticle 
)
protected

Function that affects a particle by the affectors that are part of this particle technique.

void ParticleUniverse::ParticleTechnique::_processDependencies ( void  )
protected

Determine the dependencies and process them.

void ParticleUniverse::ParticleTechnique::_processExternals ( Particle particle,
Real  timeElapsed,
bool  firstParticle 
)
protected

Function that uses an external source - outside the partice technique - to affect the particle.

void ParticleUniverse::ParticleTechnique::_processMotion ( Particle particle,
Real  timeElapsed,
bool  firstParticle 
)
inlineprotected

Apply motion to a particle.

void ParticleUniverse::ParticleTechnique::_processObservers ( Particle particle,
Real  timeElapsed,
bool  firstParticle 
)
protected

Observers are classes that ŽwatchŽ at a particle and perform an action as soon as a certain threshold is exceeded. This function calls all observers.

void ParticleUniverse::ParticleTechnique::_processParticles ( Real  timeElapsed)
protected

Apply actions on the emitted particles (expire, affect, observe, ...).

void ParticleUniverse::ParticleTechnique::_processParticleSelf ( Particle particle,
Real  timeElapsed,
bool  firstParticle 
)
inlineprotected

Perform actions on a single particle after each update.

Remarks
Besides affecting particles by affectors (which apply a global effect on a particle), particles can also affect themselves.
void ParticleUniverse::ParticleTechnique::_processRenderer ( Particle particle,
Real  timeElapsed,
bool  firstParticle 
)
protected

Some renderers also perform additional activities on particles (besides renderering).

void ParticleUniverse::ParticleTechnique::_processSpatialHashing ( Particle particle,
Real  timeElapsed 
)
protected

If spatial hashing is required, the particle will be put in a hashtable.

void ParticleUniverse::ParticleTechnique::_pushTechniqueEvent ( EventType  eventType)
protected

Convenient function to push an event.

void ParticleUniverse::ParticleTechnique::_removeBehaviourTemplate ( ParticleBehaviour behaviourTemplate)

Remove a ParticleBehaviour template.

void ParticleUniverse::ParticleTechnique::_resetBounds ( void  )

Reset the bounds.

void ParticleUniverse::ParticleTechnique::_resetMarkForEmission ( void  )
protected

Reset all MarkForEmission values (to false) for all techniques, affectors and emitters.

void ParticleUniverse::ParticleTechnique::_sortVisualParticles ( Camera camera)

Sort the visual particles.

Remarks
Only the visual particles are sorted, because sorting non-visual particles doesn't make sense.
void ParticleUniverse::ParticleTechnique::_unprepare ( void  )

V1.5: Perform some cleanup activities.

void ParticleUniverse::ParticleTechnique::_unprepareAffectors ( void  )
void ParticleUniverse::ParticleTechnique::_unprepareBehaviours ( void  )
void ParticleUniverse::ParticleTechnique::_unprepareEmitters ( void  )
void ParticleUniverse::ParticleTechnique::_unprepareExterns ( void  )
void ParticleUniverse::ParticleTechnique::_unprepareRenderer ( void  )
void ParticleUniverse::ParticleTechnique::_unprepareSystem ( void  )
void ParticleUniverse::ParticleTechnique::_unprepareTechnique ( void  )
void ParticleUniverse::ParticleTechnique::_unprepareVisualParticles ( void  )
void ParticleUniverse::ParticleTechnique::_update ( Real  timeElapsed)

Update this ParticleTechnique.

Remarks
Updating the ParticleTechnique actually sets all particles in motion. The ParticleTechnique is only updated if the ParticleSystem to which the ParticleTechnique belongs is started.
void ParticleUniverse::ParticleTechnique::_updateRenderQueue ( Ogre::RenderQueue queue)

Update the renderqueue.

Remarks
This function invokes the renderer and updates the renderqueue of that renderer. This is not only performed for this ParticleTechnique, but also for the pooled ParticleTechniques if available. Updating the renderqueue causes the particles to be actually rendered.
void ParticleUniverse::ParticleTechnique::_updateRenderQueuePooledTechniques ( Ogre::RenderQueue queue)
protected

Updates the renderqueue of pooled ParticleTechniques.

Remarks
It is possible to emit ParticleTechniques, where these ParticleTechniques are created by and stored in the particle pool. Since they aren't the responsibility of the ParticleSystem itself, they also aren't updated by the ParticleSystem. This means that the ParticleTechnique that emits the pooled ParticleTechniques, must update them.
void ParticleUniverse::ParticleTechnique::addAffector ( ParticleAffector affector)

Add a ParticleAffector to this ParticleTechnique.

Parameters
Pointerto a previously created affector.
void ParticleUniverse::ParticleTechnique::addEmitter ( ParticleEmitter emitter)

Add a ParticleEmitter to this ParticleTechnique.

Remarks
It must be possible to add a previously created emitter to the list. This is the case with emitters that were created outside the technique. An example is the creation of emitters by means of a script. The emitter will be placed under control of the technique. The Emitter Factory however, deletes the emitters (since they are also created by the factory).
Parameters
emitterPointer to a previously created emitter.
void ParticleUniverse::ParticleTechnique::addExtern ( Extern externObject)

Add an Extern to this ParticleTechnique.

Parameters
Pointerto a previously created Extern object.
void ParticleUniverse::ParticleTechnique::addObserver ( ParticleObserver observer)

Add a ParticleObserver to this ParticleTechnique.

Parameters
Pointerto a previously created observer.
void ParticleUniverse::ParticleTechnique::addTechniqueListener ( TechniqueListener techniqueListener)

Add a TechniqueListener, which gets called in case a particle is emitted or expired.

virtual void ParticleUniverse::ParticleTechnique::copyAttributesTo ( ParticleTechnique technique)
virtual

Copy the attributes of this ParticleTechnique to another ParticleTechnique.

ParticleAffector* ParticleUniverse::ParticleTechnique::createAffector ( const String affectorType)

Create a ParticleAffector and add it to this ParticleTechnique.

ParticleEmitter* ParticleUniverse::ParticleTechnique::createEmitter ( const String emitterType)

Create a ParticleEmitter and add it to this ParticleTechnique.

Extern* ParticleUniverse::ParticleTechnique::createExtern ( const String externType)

Create an Extern and add it to this ParticleTechnique.

ParticleObserver* ParticleUniverse::ParticleTechnique::createObserver ( const String observerType)

Create a ParticleObserver and add it to this ParticleTechnique.

void ParticleUniverse::ParticleTechnique::destroyAffector ( size_t  index)

Delete a ParticleAffector that is part of this ParticleTechnique. Search by index.

void ParticleUniverse::ParticleTechnique::destroyAffector ( ParticleAffector affector)

Delete a ParticleAffector that is part of this ParticleTechnique.

void ParticleUniverse::ParticleTechnique::destroyAllAffectors ( void  )

Delete all ParticleAffectors of this ParticleTechnique.

void ParticleUniverse::ParticleTechnique::destroyAllEmitters ( void  )

Delete all ParticleEmitters of this ParticleTechnique.

void ParticleUniverse::ParticleTechnique::destroyAllExterns ( void  )

Delete all Externs of this ParticleTechnique.

void ParticleUniverse::ParticleTechnique::destroyAllObservers ( void  )

Delete all ParticleObservers of this ParticleTechnique.

void ParticleUniverse::ParticleTechnique::destroyEmitter ( size_t  index)

Delete a ParticleEmitter that is part of this ParticleTechnique. Search by index.

void ParticleUniverse::ParticleTechnique::destroyEmitter ( ParticleEmitter emitter)

Delete a ParticleEmitter that is part of this ParticleTechnique.

void ParticleUniverse::ParticleTechnique::destroyExtern ( size_t  index)

Delete an Extern that is part of this ParticleTechnique. Search by index.

void ParticleUniverse::ParticleTechnique::destroyExtern ( Extern externObject)

Delete an Extern that is part of this ParticleTechnique.

void ParticleUniverse::ParticleTechnique::destroyObserver ( size_t  index)

Delete a ParticleObserver that is part of this ParticleTechnique. Search by index.

void ParticleUniverse::ParticleTechnique::destroyObserver ( ParticleObserver observer)

Delete a ParticleObserver that is part of this ParticleTechnique.

void ParticleUniverse::ParticleTechnique::destroyRenderer ( void  )

Delete the renderer of this ParticleTechnique.

void ParticleUniverse::ParticleTechnique::forceEmission ( ParticleEmitter emitter,
unsigned  requested 
)

Forces emission of particles.

Remarks
The number of requested particles are the exact number that are emitted. No down-scalling is applied.
void ParticleUniverse::ParticleTechnique::forceEmission ( const Particle::ParticleType  particleType,
unsigned  requested 
)

Emits particles of the first emitter it encounters in this technique.

ParticleAffector* ParticleUniverse::ParticleTechnique::getAffector ( size_t  index) const

Get a ParticleAffector. Search by index.

ParticleAffector* ParticleUniverse::ParticleTechnique::getAffector ( const String affectorName) const

Get a ParticleAffector. Search by name.

Real ParticleUniverse::ParticleTechnique::getCameraSquareDistance ( void  ) const
inline

Get/Set the squared distance between camera and ParticleTechnique.

const Real ParticleUniverse::ParticleTechnique::getDefaultDepth ( void  ) const
const Real ParticleUniverse::ParticleTechnique::getDefaultHeight ( void  ) const
const Real ParticleUniverse::ParticleTechnique::getDefaultWidth ( void  ) const
CameraDependency* ParticleUniverse::ParticleTechnique::getDepthCameraDependency ( void  ) const
const Vector3& ParticleUniverse::ParticleTechnique::getDerivedPosition ( void  )

Returns the derived position of the technique.

Remarks
Note, that in script, the position is set into localspace, while if the technique is emitted, its position is automatically transformed. This function always returns the derived position.
size_t ParticleUniverse::ParticleTechnique::getEmittedAffectorQuota ( void  ) const
size_t ParticleUniverse::ParticleTechnique::getEmittedEmitterQuota ( void  ) const
size_t ParticleUniverse::ParticleTechnique::getEmittedSystemQuota ( void  ) const
size_t ParticleUniverse::ParticleTechnique::getEmittedTechniqueQuota ( void  ) const
ParticleEmitter* ParticleUniverse::ParticleTechnique::getEmitter ( size_t  index) const

Get a ParticleEmitter. Search by index.

ParticleEmitter* ParticleUniverse::ParticleTechnique::getEmitter ( const String emitterName) const

Get a ParticleEmitter. Search by name.

Extern* ParticleUniverse::ParticleTechnique::getExtern ( size_t  index) const

Get an Extern. Search by index.

Extern* ParticleUniverse::ParticleTechnique::getExtern ( const String externName) const

Get an Extern. Search by name.

Extern* ParticleUniverse::ParticleTechnique::getExternType ( const String externType) const

Get an Extern. Search by type.

CameraDependency* ParticleUniverse::ParticleTechnique::getHeightCameraDependency ( void  ) const
unsigned short ParticleUniverse::ParticleTechnique::getLodIndex ( void  ) const
inline

Get the Lod index.

Remarks
The Lod index determines at which distance this ParticleTechnique is active. This has only effect if the Lod distances of the ParticleSystem to which this ParticleTechnique belongs have been defined.
const Ogre::MaterialPtr ParticleUniverse::ParticleTechnique::getMaterial ( void  ) const

Get the material pointer.

const String& ParticleUniverse::ParticleTechnique::getMaterialName ( void  ) const

Set the name of the material used by the renderer.

Real ParticleUniverse::ParticleTechnique::getMaxVelocity ( void  ) const

Return the maximum velocity a particle can have, even if the velocity of the particle has been set higher (either by initialisation of the particle or by means of an affector).

const String& ParticleUniverse::ParticleTechnique::getName ( void  ) const
inline
size_t ParticleUniverse::ParticleTechnique::getNumAffectors ( void  ) const

Get the number of ParticleAffectors added to this ParticleTechnique.

size_t ParticleUniverse::ParticleTechnique::getNumberOfEmittedParticles ( void  )
size_t ParticleUniverse::ParticleTechnique::getNumberOfEmittedParticles ( Particle::ParticleType  particleType)
size_t ParticleUniverse::ParticleTechnique::getNumEmittedAffectors ( void  ) const

Get the number of emitted ParticleAffectors.

Remarks
This doesn't return the real number of emitted affectors, but the number of affectors that are marked for emission.
size_t ParticleUniverse::ParticleTechnique::getNumEmittedEmitters ( void  ) const

Get the number of emitted ParticleEmitters.

Remarks
This doesn't return the real number of emitted emitters, but the number of emitters that are marked for emission.
size_t ParticleUniverse::ParticleTechnique::getNumEmitters ( void  ) const

Get the number of ParticleEmitters added to this ParticleTechnique.

size_t ParticleUniverse::ParticleTechnique::getNumExterns ( void  ) const

Get the number of Externs added to this ParticleTechnique.

size_t ParticleUniverse::ParticleTechnique::getNumObservers ( void  ) const

Get the number of ParticleObservers added to this ParticleTechnique.

ParticleObserver* ParticleUniverse::ParticleTechnique::getObserver ( size_t  index) const

Get a ParticleObserver. Search by index.

ParticleObserver* ParticleUniverse::ParticleTechnique::getObserver ( const String observerName) const

Get a ParticleObserver. Search by name.

ParticleSystem* ParticleUniverse::ParticleTechnique::getParentSystem ( void  ) const
inline
Real ParticleUniverse::ParticleTechnique::getParticleSystemScaleVelocity ( void  ) const

Returns the velocity scale, defined in the particle system, but passed to the technique for convenience.

ParticleRenderer* ParticleUniverse::ParticleTechnique::getRenderer ( void  ) const

Returns the pointer to the renderer.

unsigned short ParticleUniverse::ParticleTechnique::getSpatialHashingCellDimension ( void  ) const

Returns the celsize used in spatial hashing.

unsigned short ParticleUniverse::ParticleTechnique::getSpatialHashingCellOverlap ( void  ) const

Return the size of the overlap.

Real ParticleUniverse::ParticleTechnique::getSpatialHashingInterval ( void  ) const

Return the interval when the spatial hashtable is updated.

SpatialHashTable<Particle*>* ParticleUniverse::ParticleTechnique::getSpatialHashTable ( void  ) const

Returns the Spatial Hashtable.

unsigned int ParticleUniverse::ParticleTechnique::getSpatialHashTableSize ( void  ) const

Returns the size of the hashtable used in spatial hashing.

size_t ParticleUniverse::ParticleTechnique::getVisualParticleQuota ( void  ) const
CameraDependency* ParticleUniverse::ParticleTechnique::getWidthCameraDependency ( void  ) const
const AxisAlignedBox& ParticleUniverse::ParticleTechnique::getWorldBoundingBox ( void  ) const
inline

Returns the world aabb.

void ParticleUniverse::ParticleTechnique::initVisualDataInPool ( void  )

Reset the visual data in the pool.

Remarks
Visual particles may keep some additional visual data that needs to be reset in some cases. This function puts all particles back into the pool.
bool ParticleUniverse::ParticleTechnique::isKeepLocal ( void  ) const
bool ParticleUniverse::ParticleTechnique::isSpatialHashingParticleSizeUsed ( void  ) const

Return the indication whether to use only the particle position (false) or take the particle size into account (true).

bool ParticleUniverse::ParticleTechnique::isSpatialHashingUsed ( void  ) const

Returns true if spatial hashing is used.

bool ParticleUniverse::ParticleTechnique::isStopFade ( void  )

if stopFade is set, emitter must not emit new particles anymore

void ParticleUniverse::ParticleTechnique::lockAllParticles ( void  )

Put all emitted particles back into the pool.

void ParticleUniverse::ParticleTechnique::logDebug ( void  )

Generates debug information, such as max. used particles in a technique.

bool ParticleUniverse::ParticleTechnique::makeParticleLocal ( Particle particle)
inline

Transforms the particle position in a local position relative to the technique

void ParticleUniverse::ParticleTechnique::pushEvent ( ParticleUniverseEvent particleUniverseEvent)

Forwards an event to the parent particle system.

void ParticleUniverse::ParticleTechnique::removeAffector ( ParticleAffector affector)

Remove a ParticleAffector from the ParticleTechnique, but donŽt delete it.

Parameters
Pointerto a ParticleAffector object.
void ParticleUniverse::ParticleTechnique::removeEmitter ( ParticleEmitter emitter)

Remove a ParticleEmitter from the ParticleTechnique, but donŽt delete it.

Parameters
Pointerto a ParticleEmitter object.
void ParticleUniverse::ParticleTechnique::removeExtern ( Extern externObject)

Remove an Extern from the ParticleTechnique, but donŽt delete it.

Parameters
Pointerto an Extern object.
void ParticleUniverse::ParticleTechnique::removeObserver ( ParticleObserver observer)

Remove a ParticleObserver from the ParticleTechnique, but donŽt delete it.

Parameters
Pointerto a ParticleObserver object.
void ParticleUniverse::ParticleTechnique::removeRenderer ( ParticleRenderer renderer)

Remove a renderer; this doesn't detroy it.

void ParticleUniverse::ParticleTechnique::removeTechniqueListener ( TechniqueListener techniqueListener)

Removes the TechniqueListener, but it isn't destroyed.

void ParticleUniverse::ParticleTechnique::setCameraSquareDistance ( Real  cameraSquareDistance)
inline
void ParticleUniverse::ParticleTechnique::setDefaultDepth ( const Real  depth)
void ParticleUniverse::ParticleTechnique::setDefaultHeight ( const Real  height)
void ParticleUniverse::ParticleTechnique::setDefaultWidth ( const Real  width)
void ParticleUniverse::ParticleTechnique::setDepthCameraDependency ( CameraDependency cameraDependency)
void ParticleUniverse::ParticleTechnique::setDepthCameraDependency ( Real  squareDistance,
bool  inc 
)
void ParticleUniverse::ParticleTechnique::setEmittedAffectorQuota ( size_t  quota)
void ParticleUniverse::ParticleTechnique::setEmittedEmitterQuota ( size_t  quota)
void ParticleUniverse::ParticleTechnique::setEmittedSystemQuota ( size_t  quota)
void ParticleUniverse::ParticleTechnique::setEmittedTechniqueQuota ( size_t  quota)
void ParticleUniverse::ParticleTechnique::setHeightCameraDependency ( CameraDependency cameraDependency)
void ParticleUniverse::ParticleTechnique::setHeightCameraDependency ( Real  squareDistance,
bool  inc 
)
void ParticleUniverse::ParticleTechnique::setKeepLocal ( bool  keepLocal)

If this attribute is set to 'true', the particles are emitted relative to the technique

void ParticleUniverse::ParticleTechnique::setLodIndex ( unsigned short  lodIndex)
inline

Set the Lod index.

void ParticleUniverse::ParticleTechnique::setMaterialName ( const String materialName)

Set the name of the material used by the renderer.

void ParticleUniverse::ParticleTechnique::setMaxVelocity ( Real  maxVelocity)

Set the maximum velocity a particle can have.

void ParticleUniverse::ParticleTechnique::setName ( const String name)
inline
void ParticleUniverse::ParticleTechnique::setParentSystem ( ParticleSystem parentSystem)
inline
void ParticleUniverse::ParticleTechnique::setRenderer ( const String rendererType)

Set a renderer by means of the type of renderer.

void ParticleUniverse::ParticleTechnique::setRenderer ( ParticleRenderer renderer)

Set a renderer.

void ParticleUniverse::ParticleTechnique::setRenderQueueGroup ( uint8  queueId)

Set the renderqueue group in the renderer

void ParticleUniverse::ParticleTechnique::setSpatialHashingCellDimension ( unsigned short  spatialHashingCellDimension)

Set the celsize used in spatial hashing. A cel represents a small part of the 3d space in which particles may exist. The size of the cel is the same for both x, y and z dimension.

void ParticleUniverse::ParticleTechnique::setSpatialHashingCellOverlap ( unsigned short  spatialHashingCellOverlap)

Set the size of the overlap.

Remarks
The cell overlap is used to put a particle in multiple cells if needed. This is a better way to determine nearby particles. A particle in one cell is not considered nearby in relation to a particle in another cel, although they can be nearby in terms of their world position. If you want to inspect all particles positioned in a radius around a central particle, and that particle is close to the border of a cel, you miss a few particles in the neighbouring cell that are nearby. By defining an overlap you duplicate particles in multiple cells, but you are able to determine all nearby particles.
Because particle are duplicated in multiple cells, you have to consider that validations between 2 particles in one cell are also performed in another cell. Set a flag to a particle, indicating that it has been validated.
void ParticleUniverse::ParticleTechnique::setSpatialHashingInterval ( Real  spatialHashingInterval)

Set the interval when the spatial hashtable is updated.

void ParticleUniverse::ParticleTechnique::setSpatialHashingParticleSizeUsed ( bool  spatialHashingParticleSizeUsed)

Set the indication whether to use only the particle position (false) or take the particle size into account (true).

void ParticleUniverse::ParticleTechnique::setSpatialHashingUsed ( bool  spatialHashingUsed)

Defines whether spatial hashing is used.

void ParticleUniverse::ParticleTechnique::setSpatialHashTableSize ( unsigned int  spatialHashTableSize)

Sets the size of the hashtable used in spatial hashing.

void ParticleUniverse::ParticleTechnique::setVisualParticleQuota ( size_t  quota)
void ParticleUniverse::ParticleTechnique::setWidthCameraDependency ( CameraDependency cameraDependency)
void ParticleUniverse::ParticleTechnique::setWidthCameraDependency ( Real  squareDistance,
bool  inc 
)
void ParticleUniverse::ParticleTechnique::suppressNotifyEmissionChange ( bool  suppress)

Function to suppress notification of an emission change.

See also
ParticleTechnique

Member Data Documentation

Vector3 ParticleUniverse::ParticleTechnique::_mParticleSystemScale
protected

Although the scale is on a Particle System level, it is stored here also, because this value is often used. It is a derived value, so it has not get a get and set function.

Real ParticleUniverse::ParticleTechnique::_mParticleSystemScaleVelocity
protected

Although the velocity scale is on a Particle System level, it is stored here also, because this value is often used. It is a derived value, so it has not get a get and set function.

const Real ParticleUniverse::ParticleTechnique::DEFAULT_DEPTH
static
const size_t ParticleUniverse::ParticleTechnique::DEFAULT_EMITTED_AFFECTOR_QUOTA
static
const size_t ParticleUniverse::ParticleTechnique::DEFAULT_EMITTED_EMITTER_QUOTA
static
const size_t ParticleUniverse::ParticleTechnique::DEFAULT_EMITTED_SYSTEM_QUOTA
static
const size_t ParticleUniverse::ParticleTechnique::DEFAULT_EMITTED_TECHNIQUE_QUOTA
static
const bool ParticleUniverse::ParticleTechnique::DEFAULT_ENABLED
static
const Real ParticleUniverse::ParticleTechnique::DEFAULT_HEIGHT
static
const bool ParticleUniverse::ParticleTechnique::DEFAULT_KEEP_LOCAL
static
const unsigned short ParticleUniverse::ParticleTechnique::DEFAULT_LOD_INDEX
static
const Real ParticleUniverse::ParticleTechnique::DEFAULT_MAX_VELOCITY
static
const Vector3 ParticleUniverse::ParticleTechnique::DEFAULT_POSITION
static
const unsigned short ParticleUniverse::ParticleTechnique::DEFAULT_SPATIAL_HASHING_CELL_DIM
static
const unsigned short ParticleUniverse::ParticleTechnique::DEFAULT_SPATIAL_HASHING_CELL_OVERLAP
static
const Real ParticleUniverse::ParticleTechnique::DEFAULT_SPATIAL_HASHING_INTERVAL
static
const size_t ParticleUniverse::ParticleTechnique::DEFAULT_SPATIAL_HASHING_TABLE_SIZE
static
const size_t ParticleUniverse::ParticleTechnique::DEFAULT_VISUAL_PARTICLE_QUOTA
static
const Real ParticleUniverse::ParticleTechnique::DEFAULT_WIDTH
static
ParticleAffectorList ParticleUniverse::ParticleTechnique::mAffectors
protected

List containing registered ParticleAffectors.

Particle::ParticleBehaviourList ParticleUniverse::ParticleTechnique::mBehaviourTemplates
protected

List containing registered Behaviour templates.

Remarks
Note, that the ParticleBehaviours are only used as a blueprint. The actual ParticleBehaviour objects that are used in the ParticleUniverse plugin are attached to a Particle.
CameraDependencyFactory ParticleUniverse::ParticleTechnique::mCameraDependencyFactory
protected

Helper Factory to create a CameraDependency.

Real ParticleUniverse::ParticleTechnique::mCameraSquareDistance
protected

Distance between the latest camera that updated the renderqueue and the particle system.

Remarks
This is really only usable with a 1 camera set-up, because it always calculates the square distance between the technique and the latest camera update and youŽll never know which camera it was. The reason to have this attribute is to be able to apply LOD to a Particle System and Particle System LOD is only effective with 1 camera (otherwise, with more cameraŽs there is a risk that more than 1 Particle Technique is emitting)
ParticleAffectorList ParticleUniverse::ParticleTechnique::mCopyOfPooledAffectors
protected

Because the particle pool is not capable to iterate multiple times at once, an extraction of the pooled ParticleAffectors is made.

SpatialHashTable<Particle*>* ParticleUniverse::ParticleTechnique::mCurrentSpatialHashTable
protected
Real ParticleUniverse::ParticleTechnique::mDefaultDepth
protected

Default depth of each visual particle.

Real ParticleUniverse::ParticleTechnique::mDefaultHeight
protected

Default height of each visual particle.

Real ParticleUniverse::ParticleTechnique::mDefaultWidth
protected

Default width of each visual particle.

CameraDependency* ParticleUniverse::ParticleTechnique::mDepthCameraDependency
protected

CameraDependency that causes a decrease (or increase if needed) of the particle depth.

size_t ParticleUniverse::ParticleTechnique::mEmittedAffectorQuota
protected

The maximum number of affector particles that can be emitted.

size_t ParticleUniverse::ParticleTechnique::mEmittedEmitterQuota
protected

The maximum number of emitter particles that can be emitted.

size_t ParticleUniverse::ParticleTechnique::mEmittedSystemQuota
protected

The maximum number of particle system particles that can be emitted.

size_t ParticleUniverse::ParticleTechnique::mEmittedTechniqueQuota
protected

The maximum number of technique particles that can be emitted.

ParticleEmitterList ParticleUniverse::ParticleTechnique::mEmitters
protected

List containing registered ParticleEmitters.

ExternList ParticleUniverse::ParticleTechnique::mExterns
protected

List containing registered Externs.

bool ParticleUniverse::ParticleTechnique::mHasExtents
protected
CameraDependency* ParticleUniverse::ParticleTechnique::mHeightCameraDependency
protected

CameraDependency that causes a decrease (or increase if needed) of the particle height.

bool ParticleUniverse::ParticleTechnique::mIsSpatialHashingInitialised
protected
bool ParticleUniverse::ParticleTechnique::mIsSpatialHashingUsed
protected

If needed, the particles can be structured in a spatial hashtable. This is a fast way to store particles that are near each other in 3d space. The hashtable can be used for inter-particle collision or nearest neighbour search.

Remarks
We are using 2 hashtables. One table is filled during frame 1 and used in frame 2, while the other table is used in frame 1 and filled in frame 2. By swapping the tables after each frame we have the possibility to compare each particle in the processParticles loop with the particles in the currently used hashtable.
bool ParticleUniverse::ParticleTechnique::mKeepLocal
protected

Determines whether particle positions should be kept local in relation to the technique.

unsigned short ParticleUniverse::ParticleTechnique::mLodIndex
protected

Lod level.

Remarks
The mLodIndex corresponds to one of the lod distances set by the ParticleSystem. If the distance between the ParticleTechnique and the camera corresponds with the index of the ParticleTechnique, the ParticleTechnique will be enabled, otherwise the ParticleTechnique is disabled.
Note, that mLodIndex only has a meaning if the lod distances are set by the ParticleSystem, otherwise it is ignored (which enables all ParticleTechniques).
String ParticleUniverse::ParticleTechnique::mMaterialName
protected

Name of the material used in the renderer.

size_t ParticleUniverse::ParticleTechnique::mMaxNumAffectorParticles
protected
size_t ParticleUniverse::ParticleTechnique::mMaxNumEmitterParticles
protected
size_t ParticleUniverse::ParticleTechnique::mMaxNumSystemParticles
protected
size_t ParticleUniverse::ParticleTechnique::mMaxNumTechniqueParticles
protected
size_t ParticleUniverse::ParticleTechnique::mMaxNumVisualParticles
protected

Keeps track of maximum number of emitted particles.

Real ParticleUniverse::ParticleTechnique::mMaxVelocity
protected

Attributes that limit the velocity of the particles in this technique.

bool ParticleUniverse::ParticleTechnique::mMaxVelocitySet
protected
Vector3 ParticleUniverse::ParticleTechnique::mMaxWorldExtend
protected
Vector3 ParticleUniverse::ParticleTechnique::mMinWorldExtend
protected

Min/max extends of the WorldAABB.

String ParticleUniverse::ParticleTechnique::mName
protected

Name of the technique (optional).

ParticleObserverList ParticleUniverse::ParticleTechnique::mObservers
protected

List containing registered ParticleObservers.

ParticleSystem* ParticleUniverse::ParticleTechnique::mParentSystem
protected

Parent Particle System of this technique.

bool ParticleUniverse::ParticleTechnique::mParticleAffectorPoolIncreased
protected
bool ParticleUniverse::ParticleTechnique::mParticleEmitterPoolIncreased
protected
bool ParticleUniverse::ParticleTechnique::mParticleSystemPoolIncreased
protected
bool ParticleUniverse::ParticleTechnique::mParticleTechniquePoolIncreased
protected
ParticlePool ParticleUniverse::ParticleTechnique::mPool
protected

Particle pool.

Remarks
The particle pool contains precreated particles. In most cases these particles are visual particles, but the pool can also contain ParticleEmitters, ParticleAffectors and ParticleTechniques that are emitted.
bool ParticleUniverse::ParticleTechnique::mPrepareAffector
protected

Indication used to determine whether the Affector objects must be prepared.

bool ParticleUniverse::ParticleTechnique::mPrepareBehaviour
protected

Indication used to determine whether the Behaviour objects must be prepared.

bool ParticleUniverse::ParticleTechnique::mPrepareEmitter
protected

Indication used to determine whether the Emitter objects must be prepared.

bool ParticleUniverse::ParticleTechnique::mPrepareExtern
protected

Indication used to determine whether the Extern objects must be prepared.

RadixSort<Pool<VisualParticle>::PoolList, Particle*, float> ParticleUniverse::ParticleTechnique::mRadixSorter
staticprotected

Sort the particles.

ParticleRenderer* ParticleUniverse::ParticleTechnique::mRenderer
protected

Particle Renderer.

unsigned short ParticleUniverse::ParticleTechnique::mSpatialHashingCellDimension
protected
unsigned short ParticleUniverse::ParticleTechnique::mSpatialHashingCellOverlap
protected
Real ParticleUniverse::ParticleTechnique::mSpatialHashingInterval
protected

Attributes that determine that the spatial hashtable is the updated after every interval.

bool ParticleUniverse::ParticleTechnique::mSpatialHashingIntervalActivate
protected
Real ParticleUniverse::ParticleTechnique::mSpatialHashingIntervalRemainder
protected
bool ParticleUniverse::ParticleTechnique::mSpatialHashingIntervalSet
protected
SpatialHashTable<Particle*>* ParticleUniverse::ParticleTechnique::mSpatialHashTableA
protected
SpatialHashTable<Particle*>* ParticleUniverse::ParticleTechnique::mSpatialHashTableB
protected
unsigned int ParticleUniverse::ParticleTechnique::mSpatialHashTableSize
protected
bool ParticleUniverse::ParticleTechnique::mSuppressNotifyEmissionChange
protected

Indication whether _notifyEmissionChange() must be suppressed or not.

Remarks
Default is true
TechniqueListenerList ParticleUniverse::ParticleTechnique::mTechniqueListenerList
protected

List of TechniqueListeners

bool ParticleUniverse::ParticleTechnique::mUpdateWorldAABB
protected

Determines whether the Particle Technique should update their bounds.

bool ParticleUniverse::ParticleTechnique::mVisualParticlePoolIncreased
protected

Indication whether elements of the the particle pool are initialized.

size_t ParticleUniverse::ParticleTechnique::mVisualParticleQuota
protected

The maximum number of visual particles that can be emitted.

CameraDependency* ParticleUniverse::ParticleTechnique::mWidthCameraDependency
protected

CameraDependency that causes a decrease (or increase if needed) of the particle width.

AxisAlignedBox ParticleUniverse::ParticleTechnique::mWorldAABB
protected

World AABB.

Remarks
Because all positions are in worldspace, the ParticleTechnique's worldspace bounding box is calculated.

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