Go to the documentation of this file.
28 #ifndef __ParticleSystem_H__
29 #define __ParticleSystem_H__
75 String doGet(
const void* target)
const;
76 void doSet(
void* target,
const String& val);
82 String doGet(
const void* target)
const;
83 void doSet(
void* target,
const String& val);
89 String doGet(
const void* target)
const;
90 void doSet(
void* target,
const String& val);
96 String doGet(
const void* target)
const;
97 void doSet(
void* target,
const String& val);
103 String doGet(
const void* target)
const;
104 void doSet(
void* target,
const String& val);
110 String doGet(
const void* target)
const;
111 void doSet(
void* target,
const String& val);
117 String doGet(
const void* target)
const;
118 void doSet(
void* target,
const String& val);
124 String doGet(
const void* target)
const;
125 void doSet(
void* target,
const String& val);
131 String doGet(
const void* target)
const;
132 void doSet(
void* target,
const String& val);
138 String doGet(
const void* target)
const;
139 void doSet(
void* target,
const String& val);
145 String doGet(
const void* target)
const;
146 void doSet(
void* target,
const String& val);
169 void setRenderer(
const String& typeName);
174 const String& getRendererName(
void)
const;
199 unsigned short getNumEmitters(
void)
const;
209 void removeEmitter(
unsigned short index);
212 void removeAllEmitters(
void);
238 unsigned short getNumAffectors(
void)
const;
248 void removeAffector(
unsigned short index);
251 void removeAllAffectors(
void);
264 size_t getNumParticles(
void)
const;
296 Particle* getParticle(
size_t index);
302 size_t getParticleQuota(
void)
const;
315 void setParticleQuota(
size_t quota);
321 size_t getEmittedEmitterQuota(
void)
const;
328 void setEmittedEmitterQuota(
size_t quota);
343 void _update(
Real timeElapsed);
362 virtual const String& getMaterialName(
void)
const;
368 virtual void _notifyCurrentCamera(
Camera* cam);
374 void _notifyAttached(
Node* parent,
bool isTagPoint =
false);
392 virtual void _updateRenderQueue(
RenderQueue* queue);
396 bool debugRenderables =
false);
410 void fastForward(
Real time,
Real interval = 0.1);
441 void setIterationInterval(
Real iterationInterval);
469 void setNonVisibleUpdateTimeout(
Real timeout);
478 { msDefaultNonvisibleTimeout = timeout; }
485 const String& getMovableType(
void)
const;
489 virtual void _notifyParticleResized(
void);
493 virtual void _notifyParticleRotated(
void);
505 virtual void setDefaultDimensions(
Real width,
Real height);
508 virtual void setDefaultWidth(
Real width);
510 virtual Real getDefaultWidth(
void)
const;
512 virtual void setDefaultHeight(
Real height);
514 virtual Real getDefaultHeight(
void)
const;
516 virtual bool getCullIndividually(
void)
const;
537 virtual void setCullIndividually(
bool cullIndividual);
551 void setRenderQueueGroup(
uint8 queueID);
553 void setRenderQueueGroupAndPriority(
uint8 queueID,
ushort priority);
592 void setBoundsAutoUpdated(
bool autoUpdate,
Real stopIn = 0.0f);
603 void setKeepParticlesInLocalSpace(
bool keepLocal);
623 void _updateBounds(
void);
634 void setEmitting(
bool v);
641 bool getEmitting()
const;
644 uint32 getTypeFlags(
void)
const;
718 float operator()(
Particle* p)
const;
728 float operator()(
Particle* p)
const;
822 void _expire(
Real timeElapsed);
825 void _triggerEmitters(
Real timeElapsed);
829 void _executeTriggerEmitters(
ParticleEmitter* emitter,
unsigned requested,
Real timeElapsed);
832 void _applyMotion(
Real timeElapsed);
835 void _triggerAffectors(
Real timeElapsed);
838 void _sortParticles(
Camera* cam);
841 void increasePool(
size_t size);
850 void increaseEmittedEmitterPool(
size_t size);
853 void initParameters(
void);
856 void configureRenderer(
void);
859 void createVisualParticles(
size_t poolstart,
size_t poolend);
861 void destroyVisualParticles(
size_t poolstart,
size_t poolend);
868 void initialiseEmittedEmitters(
void);
873 void initialiseEmittedEmitterPool(
void);
876 void addFreeEmittedEmitters(
void);
879 void removeAllEmittedEmitters(
void);
897 void addActiveEmittedEmittersToFreeList (
void);
907 void _notifyReorganiseEmittedEmitterData (
void);
Sort by direction functor.
vector< ParticleEmitter * >::type ParticleEmitterList
bool mNonvisibleTimeoutSet
Update timeout when nonvisible set? Otherwise track default.
size_t mEmittedEmitterPoolSize
The number of emitted emitters in the pool.
Real mDefaultHeight
Default height of each particle.
Real mTimeSinceLastVisible
Amount of time non-visible so far.
bool mSorted
Particles sorted according to camera?
bool getSortingEnabled(void) const
Gets whether particles are sorted relative to the camera.
static CmdEmittedEmitterQuota msEmittedEmitterQuotaCmd
unsigned long mLastVisibleFrame
Last frame in which known to be visible.
Real mDefaultWidth
Default width of each particle.
virtual Real getBoundingRadius(void) const
Overridden from MovableObject.
A viewpoint from which the scene will be rendered.
static CmdHeight msHeightCmd
bool getKeepParticlesInLocalSpace(void) const
Gets whether particles (and any affector effects) remain relative to the node the particle system is ...
static CmdWidth msWidthCmd
Command object for renderer (see ParamCommand).
Real mSpeedFactor
Speed factor.
Command object for local space (see ParamCommand).
Abstract class defining the interface required to be implemented by classes which provide rendering c...
void setSpeedFactor(Real speedFactor)
Sets a 'speed factor' on this particle system, which means it scales the elapsed real time which has ...
static CmdNonvisibleTimeout msNonvisibleTimeoutCmd
static void setDefaultNonVisibleUpdateTimeout(Real timeout)
Set the default nonvisible timeout for all ParticleSystem instances.
virtual const String & getResourceGroupName(void) const
Return the resource group to be used to load dependent resources.
static CmdCull msCullCmd
Command objects.
Abstract class defining a movable object in a scene.
static Real getDefaultIterationInterval(void)
Get the default iteration interval for all ParticleSystem instances.
static String AUTODETECT_RESOURCE_GROUP_NAME
Special resource group name which causes resource group to be automatically determined based on searc...
AxisAlignedBox mWorldAABB
World AABB, only used to compare world-space positions to calc bounds.
static CmdQuota msQuotaCmd
list< ParticleEmitter * >::type FreeEmittedEmitterList
FreeEmittedEmitterMap mFreeEmittedEmitters
Free emitted emitter list.
Convenience class to make it easy to step through all particles in a ParticleSystem.
FreeParticleList mFreeParticles
Free particle queue.
Abstract class which is command object which gets/sets parameters.
vector< ParticleAffector * >::type ParticleAffectorList
Command object for material (see ParamCommand).
ParticleSystemRenderer * mRenderer
The renderer used to render this particle system.
Command object for cull_each (see ParamCommand).
String mMaterialName
Name of the material to use.
Command object for emittedEmitterQuota (see ParamCommand).
map< String, FreeEmittedEmitterList >::type FreeEmittedEmitterMap
list< Particle * >::type FreeParticleList
static Real getDefaultNonVisibleUpdateTimeout(void)
Get the default nonvisible timeout for all ParticleSystem instances.
bool mIsEmitting
Used to control if the particle system should emit particles or not.
bool mEmittedEmitterPoolInitialised
Indication whether the emitted emitter pool (= pool with particle emitters that are emitted) is initi...
Real getNonVisibleUpdateTimeout(void) const
Gets when the particle system should stop updating after it hasn't been visible for a while.
ActiveEmittedEmitterList mActiveEmittedEmitters
Active emitted emitter list.
EmittedEmitterPool mEmittedEmitterPool
Pool of emitted emitters for use and reuse in the active emitted emitter list.
static CmdSorted msSortedCmd
virtual const AxisAlignedBox & getBoundingBox(void) const
Overridden from MovableObject.
Vector3 sortDir
Direction to sort in.
void setSortingEnabled(bool enabled)
Set whether or not particles are sorted according to the camera.
Real getIterationInterval(void) const
Gets a 'iteration interval' on this particle system.
static Real msDefaultIterationInterval
Default iteration interval.
static CmdIterationInterval msIterationIntervalCmd
list< ParticleEmitter * >::type ActiveEmittedEmitterList
A 3D box aligned with the x/y/z axes.
Command object for particle_width (see ParamCommand).
static Real msDefaultNonvisibleTimeout
Default nonvisible update timeout.
Real mNonvisibleTimeout
Update timeout when nonvisible (0 for no timeout)
list< Particle * >::type ActiveParticleList
Class representing a single particle instance.
Abstract class defining the interface to be implemented by particle emitters.
Class defining the common interface which classes can use to present a reflection-style,...
static void setDefaultIterationInterval(Real iterationInterval)
Set the default iteration interval for all ParticleSystem instances.
Command object for quota (see ParamCommand).
String mRendererType
The name of the type of renderer used to render this system.
ParticlePool mParticlePool
Pool of particle instances for use and reuse in the active particle list.
bool mCullIndividual
Do we cull each particle individually?
ParticleAffectorList mAffectors
List of particle affectors, ie modifiers of particles.
Sort by distance functor.
Real mIterationInterval
Iteration interval.
bool mIsRendererConfigured
Have we set the material etc on the renderer?
Visitor object that can be used to iterate over a collection of Renderable instances abstractly.
String mOrigin
Optional origin of this particle system (eg script name)
bool mLocalSpace
Particles in local space?
bool mIterationIntervalSet
Iteration interval set? Otherwise track default.
Class for performing a radix sort (fast comparison-less sort based on byte value) on various standard...
const String & getOrigin(void) const
Get the origin of this particle system, e.g.
Command object for particle_height (see ParamCommand).
Class defining particle system based special effects.
Command object for nonvisible timeout (see ParamCommand).
String mResourceGroupName
Name of the resource group to use to load materials.
float Real
Software floating point type.
void _notifyOrigin(const String &origin)
Notify this particle system of it's origin.
Command object for sorting (see ParamCommand).
Command object for iteration interval(see ParamCommand).
MaterialPtr mMaterial
Pointer to the material to use.
static CmdRenderer msRendererCmd
static RadixSort< ActiveParticleList, Particle *, float > mRadixSorter
static CmdLocalSpace msLocalSpaceCmd
Real getSpeedFactor(void) const
Gets the 'speed factor' on this particle system.
Class representing a general-purpose node an articulated scene graph.
Controller< Real > * mTimeController
Controller for time update.
Abstract class defining the interface to be implemented by particle affectors.
ActiveParticleList mActiveParticles
Active particle list.
ParticleEmitterList mEmitters
List of particle emitters, ie sources of particles.
map< String, EmittedEmitterList >::type EmittedEmitterPool
Standard 3-dimensional vector.
vector< ParticleEmitter * >::type EmittedEmitterList
Class to manage the scene object rendering queue.
static CmdMaterial msMaterialCmd
Vector3 sortPos
Position to sort in.
vector< Particle * >::type ParticlePool
size_t mPoolSize
The number of particles in the pool.
Copyright © 2012 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.