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);
bool mEmittedEmitterPoolInitialised
Indication whether the emitted emitter pool (= pool with particle emitters that are emitted) is initi...
size_t mEmittedEmitterPoolSize
The number of emitted emitters in the pool.
A viewpoint from which the scene will be rendered.
static CmdQuota msQuotaCmd
Real mNonvisibleTimeout
Update timeout when nonvisible (0 for no timeout)
EmittedEmitterPool mEmittedEmitterPool
Pool of emitted emitters for use and reuse in the active emitted emitter list.
Class defining particle system based special effects.
Vector3 sortDir
Direction to sort in.
float Real
Software floating point type.
String mMaterialName
Name of the material to use.
Abstract class defining the interface required to be implemented by classes which provide rendering c...
vector< ParticleAffector * >::type ParticleAffectorList
map< String, EmittedEmitterList >::type EmittedEmitterPool
unsigned long mLastVisibleFrame
Last frame in which known to be visible.
static Real getDefaultNonVisibleUpdateTimeout(void)
Get the default nonvisible timeout for all ParticleSystem instances.
Real getIterationInterval(void) const
Gets a 'iteration interval' on this particle system.
static void setDefaultNonVisibleUpdateTimeout(Real timeout)
Set the default nonvisible timeout for all ParticleSystem instances.
Class for performing a radix sort (fast comparison-less sort based on byte value) on various standard...
bool getKeepParticlesInLocalSpace(void) const
Gets whether particles (and any affector effects) remain relative to the node the particle system is ...
virtual const String & getResourceGroupName(void) const
Return the resource group to be used to load dependent resources.
void setSortingEnabled(bool enabled)
Set whether or not particles are sorted according to the camera.
void setSpeedFactor(Real speedFactor)
Sets a 'speed factor' on this particle system, which means it scales the elapsed real time which has ...
Real mDefaultHeight
Default height of each particle.
static String AUTODETECT_RESOURCE_GROUP_NAME
Special resource group name which causes resource group to be automatically determined based on searc...
Command object for cull_each (see ParamCommand).
static CmdEmittedEmitterQuota msEmittedEmitterQuotaCmd
vector< ParticleEmitter * >::type ParticleEmitterList
A 3D box aligned with the x/y/z axes.
static void setDefaultIterationInterval(Real iterationInterval)
Set the default iteration interval for all ParticleSystem instances.
ParticleSystemRenderer * mRenderer
The renderer used to render this particle system.
String mOrigin
Optional origin of this particle system (eg script name)
bool mLocalSpace
Particles in local space?
Controller< Real > * mTimeController
Controller for time update.
Command object for particle_width (see ParamCommand).
Command object for particle_height (see ParamCommand).
static CmdCull msCullCmd
Command objects.
Abstract class defining a movable object in a scene.
static CmdNonvisibleTimeout msNonvisibleTimeoutCmd
bool mIterationIntervalSet
Iteration interval set? Otherwise track default.
ParticleEmitterList mEmitters
List of particle emitters, ie sources of particles.
Command object for quota (see ParamCommand).
void _notifyOrigin(const String &origin)
Notify this particle system of it's origin.
static CmdIterationInterval msIterationIntervalCmd
Real mSpeedFactor
Speed factor.
map< String, FreeEmittedEmitterList >::type FreeEmittedEmitterMap
Command object for nonvisible timeout (see ParamCommand).
vector< ParticleEmitter * >::type EmittedEmitterList
static CmdLocalSpace msLocalSpaceCmd
Real getNonVisibleUpdateTimeout(void) const
Gets when the particle system should stop updating after it hasn't been visible for a while...
const String & getOrigin(void) const
Get the origin of this particle system, e.g.
virtual const AxisAlignedBox & getBoundingBox(void) const
Overridden from MovableObject.
Command object for sorting (see ParamCommand).
Class defining the common interface which classes can use to present a reflection-style, self-defining parameter set to callers.
FreeEmittedEmitterMap mFreeEmittedEmitters
Free emitted emitter list.
MaterialPtr mMaterial
Pointer to the material to use.
static CmdRenderer msRendererCmd
static CmdMaterial msMaterialCmd
Class representing a single particle instance.
String mResourceGroupName
Name of the resource group to use to load materials.
Real mTimeSinceLastVisible
Amount of time non-visible so far.
bool mCullIndividual
Do we cull each particle individually?
size_t mPoolSize
The number of particles in the pool.
list< Particle * >::type ActiveParticleList
String mRendererType
The name of the type of renderer used to render this system.
static RadixSort< ActiveParticleList, Particle *, float > mRadixSorter
Visitor object that can be used to iterate over a collection of Renderable instances abstractly...
bool mIsEmitting
Used to control if the particle system should emit particles or not.
Command object for material (see ParamCommand).
ActiveEmittedEmitterList mActiveEmittedEmitters
Active emitted emitter list.
Convenience class to make it easy to step through all particles in a ParticleSystem.
Abstract class defining the interface to be implemented by particle emitters.
ParticleAffectorList mAffectors
List of particle affectors, ie modifiers of particles.
Standard 3-dimensional vector.
Sort by direction functor.
list< ParticleEmitter * >::type FreeEmittedEmitterList
Sort by distance functor.
Real mIterationInterval
Iteration interval.
virtual Real getBoundingRadius(void) const
Overridden from MovableObject.
Abstract class defining the interface to be implemented by particle affectors.
Command object for local space (see ParamCommand).
static CmdHeight msHeightCmd
list< Particle * >::type FreeParticleList
Class to manage the scene object rendering queue.
AxisAlignedBox mWorldAABB
World AABB, only used to compare world-space positions to calc bounds.
Command object for iteration interval(see ParamCommand).
static CmdSorted msSortedCmd
bool mIsRendererConfigured
Have we set the material etc on the renderer?
ParticlePool mParticlePool
Pool of particle instances for use and reuse in the active particle list.
Real getSpeedFactor(void) const
Gets the 'speed factor' on this particle system.
ActiveParticleList mActiveParticles
Active particle list.
Specialisation of SharedPtr to allow SharedPtr to be assigned to MaterialPtr.
Vector3 sortPos
Position to sort in.
static Real msDefaultIterationInterval
Default iteration interval.
bool mNonvisibleTimeoutSet
Update timeout when nonvisible set? Otherwise track default.
bool getSortingEnabled(void) const
Gets whether particles are sorted relative to the camera.
bool mSorted
Particles sorted according to camera?
Command object for emittedEmitterQuota (see ParamCommand).
static Real msDefaultNonvisibleTimeout
Default nonvisible update timeout.
list< ParticleEmitter * >::type ActiveEmittedEmitterList
Command object for renderer (see ParamCommand).
Class representing a general-purpose node an articulated scene graph.
FreeParticleList mFreeParticles
Free particle queue.
static CmdWidth msWidthCmd
static Real getDefaultIterationInterval(void)
Get the default iteration interval for all ParticleSystem instances.
Abstract class which is command object which gets/sets parameters.
vector< Particle * >::type ParticlePool
Real mDefaultWidth
Default width of each particle.