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