Go to the documentation of this file.
28 #ifndef __ParticleEmitter_H__
29 #define __ParticleEmitter_H__
void resetDimensions(void)
Utility method to reset this particle.
virtual unsigned short _getEmissionCount(Real timeElapsed)=0
Gets the number of particles which this emitter would like to emit based on the time elapsed.
virtual void setColour(const ColourValue &colourStart, const ColourValue &colourEnd)
Sets the range of colours for emitted particles.
virtual void genEmissionDirection(const Vector3 &particlePos, Vector3 &destVector)
Internal utility method for generating particle exit direction.
virtual const Vector3 & getPosition(void) const
Returns the position of this emitter relative to the center of the particle system.
String mName
The name of the emitter. The name is optional unless it is used as an emitter that is emitted itself.
Command object for particle emitter - see ParamCommand.
static EmitterCommands::CmdEmittedEmitter msEmittedEmitterCmd
virtual const ColourValue & getColour(void) const
Gets the colour of particles to be emitted.
virtual Real getTimeToLive(void) const
Gets the time each particle will live for.
virtual Real getMaxDuration(void) const
Gets the maximum duration of this emitter in seconds (see setDuration for more details)
virtual bool getEnabled(void) const
Gets the flag indicating if this emitter is enabled or not.
virtual void setEmissionRate(Real particlesPerSecond)
Sets the emission rate for this emitter.
virtual const Vector3 & getUp(void) const
Returns the up vector of the emitter.
virtual void setDirPositionReference(const Vector3 &position, bool enable)
Sets the direction of the emitter.
Command object for particle emitter - see ParamCommand.
static EmitterCommands::CmdName msNameCmd
String mType
Name of the type of emitter, MUST be initialised by subclasses.
const String & getEmittedEmitter(void) const
Returns the name of the emitter to be emitted.
Real mMaxSpeed
Max speed of particles.
Real mMinTTL
Initial time-to-live of particles (min)
static EmitterCommands::CmdPosition msPositionCmd
Radian mAngle
Angle around direction which particles may be emitted, internally radians but angleunits for interfac...
static EmitterCommands::CmdRepeatDelay msRepeatDelayCmd
Command object for particle emitter - see ParamCommand.
virtual const ColourValue & getColourRangeStart(void) const
Gets the minimum colour of particles to be emitted.
Real mMinSpeed
Min speed of particles.
virtual Real getMinDuration(void) const
Gets the minimum duration of this emitter in seconds (see setDuration for more details)
virtual void setColour(const ColourValue &colour)
Sets the initial colour of particles emitted.
virtual void setEmittedEmitter(const String &emittedEmitter)
Sets the name of the emitter to be emitted.
virtual void setMinParticleVelocity(Real min)
Returns the minimum particle velocity.
static EmitterCommands::CmdMaxVelocity msMaxVelocityCmd
virtual Real getMinRepeatDelay(void) const
Gets the minimum duration of this emitter in seconds (see setRepeatDelay for more details)
virtual ~ParticleEmitter()
Virtual destructor essential.
virtual void setColourRangeStart(const ColourValue &colour)
Sets the minimum colour of particles to be emitted.
virtual const Vector3 & getDirPositionReference() const
Returns the position reference to generate direction of emitted particles.
static EmitterCommands::CmdMaxDuration msMaxDurationCmd
virtual Real getMinTimeToLive(void) const
Gets the minimum time each particle will live for.
virtual void setDirection(const Vector3 &direction)
Sets the direction of the emitter.
Command object for particle emitter - see ParamCommand.
virtual Real getMaxParticleVelocity(void) const
Returns the maximum particle velocity.
Command object for particle emitter - see ParamCommand.
static EmitterCommands::CmdMinTTL msMinTTLCmd
bool mEnabled
Whether this emitter is currently enabled (defaults to true)
static EmitterCommands::CmdColour msColourCmd
static EmitterCommands::CmdMaxRepeatDelay msMaxRepeatDelayCmd
static EmitterCommands::CmdDirection msDirectionCmd
virtual void _initParticle(Particle *pParticle)
Initialises a particle based on the emitter's approach and parameters.
virtual bool getDirPositionReferenceEnabled() const
Returns whether direction or position reference is used.
virtual void setRepeatDelay(Real duration)
Sets the time between repeats of the emitter.
Command object for particle emitter - see ParamCommand.
Command object for particle emitter - see ParamCommand.
Command object for particle emitter - see ParamCommand.
Command object for particle emitter - see ParamCommand.
virtual Real getStartTime(void) const
Gets the start time of the emitter.
const String & getType(void) const
Returns the name of the type of emitter.
Real mDurationRemain
Current duration remainder.
static EmitterCommands::CmdMaxTTL msMaxTTLCmd
Real mRepeatDelayMin
Time between each repeat.
static EmitterCommands::CmdUp msUpCmd
Command object for particle emitter - see ParamCommand.
bool mUseDirPositionRef
When true, mDirPositionRef is used instead of mDirection to generate particles.
static EmitterCommands::CmdMinDuration msMinDurationCmd
Command object for ParticleEmitter - see ParamCommand.
virtual Real genEmissionTTL(void)
Internal utility method for generating a time-to-live for a particle.
static EmitterCommands::CmdVelocity msVelocityCmd
Vector3 mPosition
Position relative to the center of the ParticleSystem.
void addBaseParameters(void)
Internal method for setting up the basic parameter definitions for a subclass.
Wrapper class which indicates a given angle value is in Radians.
Command object for particle emitter - see ParamCommand.
Real mDurationMax
Maximum length of time the emitter will run for (0 = forever)
Command object for particle emitter - see ParamCommand.
virtual void setTimeToLive(Real minTtl, Real maxTtl)
Sets the range of lifetime for particles emitted.
virtual void setMaxDuration(Real max)
Sets the maximum duration of this emitter in seconds (see setDuration for more details)
virtual const ColourValue & getColourRangeEnd(void) const
Gets the maximum colour of particles to be emitted.
static EmitterCommands::CmdDirPositionRef msDirPositionRefCmd
virtual void setDuration(Real min, Real max)
Sets the range of random duration for this emitter.
static EmitterCommands::CmdColourRangeStart msColourRangeStartCmd
virtual Real getParticleVelocity(void) const
Returns the initial velocity of particles emitted.
Command object for particle emitter - see ParamCommand.
Class representing a single particle instance.
Real mStartTime
Start time (in seconds from start of first call to ParticleSystem to update)
virtual const Radian & getAngle(void) const
Returns the maximum angle which the initial particle direction can deviate from the emitters base dir...
const String & getName(void) const
Returns the name of the emitter.
Abstract class defining the interface to be implemented by particle emitters.
virtual void setRepeatDelay(Real min, Real max)
Sets the range of random duration for this emitter.
virtual void setDuration(Real duration)
Sets the duration of the emitter.
Class defining the common interface which classes can use to present a reflection-style,...
virtual Real getEmissionRate(void) const
Returns the emission rate set for this emitter.
virtual void genEmissionColour(ColourValue &destColour)
Internal utility method for generating a colour for a particle.
virtual Real getMaxRepeatDelay(void) const
Gets the maximum duration of this emitter in seconds (see setRepeatDelay for more details)
virtual unsigned short genConstantEmissionCount(Real timeElapsed)
Internal utility method for generating an emission count based on a constant emission rate.
Real mEmissionRate
Rate in particles per second at which this emitter wishes to emit particles.
static EmitterCommands::CmdMinVelocity msMinVelocityCmd
Command object for particle emitter - see ParamCommand.
Real mRepeatDelayRemain
Repeat delay left.
virtual bool isEmitted(void) const
Return true if the emitter is emitted by another emitter.
static EmitterCommands::CmdAngle msAngleCmd
virtual void setMinDuration(Real min)
Sets the minimum duration of this emitter in seconds (see setDuration for more details)
virtual void setPosition(const Vector3 &pos)
Sets the position of this emitter relative to the particle system center.
virtual void setMinTimeToLive(Real min)
Sets the minimum time each particle will live for.
Class representing colour.
static EmitterCommands::CmdColourRangeEnd msColourRangeEndCmd
virtual void setTimeToLive(Real ttl)
Sets the lifetime of all particles emitted.
Vector3 mUp
Notional up vector, used to speed up generation of variant directions, and also to orient some emitte...
Command object for particle emitter - see ParamCommand.
virtual const Vector3 & getDirection(void) const
Returns the base direction of the emitter.
Real mDurationMin
Minimum length of time emitter will run for (0 = forever)
Command object for particle emitter - see ParamCommand.
static EmitterCommands::CmdEmissionRate msEmissionRateCmd
String mEmittedEmitter
The name of the emitter to be emitted (optional)
static EmitterCommands::CmdMinRepeatDelay msMinRepeatDelayCmd
static EmitterCommands::CmdDuration msDurationCmd
Class defining particle system based special effects.
virtual Real getRepeatDelay(void) const
Gets the duration of the emitter from when it is created or re-enabled.
Command object for particle emitter - see ParamCommand.
Command object for particle emitter - see ParamCommand.
float Real
Software floating point type.
virtual Real getMaxTimeToLive(void) const
Gets the maximum time each particle will live for.
static EmitterCommands::CmdTTL msTTLCmd
virtual void setMinRepeatDelay(Real min)
Sets the minimum duration of this emitter in seconds (see setRepeatDelay for more details)
virtual Real getMinParticleVelocity(void) const
Returns the minimum particle velocity.
Command object for particle emitter - see ParamCommand.
virtual void setParticleVelocity(Real speed)
Sets the initial velocity of particles emitted.
Vector3 mDirection
Base direction of the emitter, may not be used by some emitters.
Command object for particle emitter - see ParamCommand.
virtual void setParticleVelocity(Real min, Real max)
Sets the initial velocity range of particles emitted.
virtual void setEmitted(bool emitted)
Set the indication (true/false) to indicate that the emitter is emitted by another emitter.
ParticleEmitter(ParticleSystem *psys)
virtual void setEnabled(bool enabled)
Sets whether or not the emitter is enabled.
virtual void setMaxRepeatDelay(Real max)
Sets the maximum duration of this emitter in seconds (see setRepeatDelay for more details)
virtual void setStartTime(Real startTime)
Sets the 'start time' of this emitter.
Standard 3-dimensional vector.
virtual void setUp(const Vector3 &up)
Sets the notional up vector of the emitter.
ColourValue mColourRangeStart
Initial colour of particles (range start)
ParticleSystem * mParent
Parent particle system.
ColourValue mColourRangeEnd
Initial colour of particles (range end)
virtual Real getDuration(void) const
Gets the duration of the emitter from when it is created or re-enabled.
Command object for particle emitter - see ParamCommand.
Real mMaxTTL
Initial time-to-live of particles (max)
virtual void setColourRangeEnd(const ColourValue &colour)
Sets the maximum colour of particles to be emitted.
virtual void setName(const String &newName)
Sets the name of the emitter.
void initDurationRepeat(void)
Internal method for initialising the duration & repeat of an emitter.
virtual void setMaxParticleVelocity(Real max)
Returns the maximum particle velocity.
virtual void setAngle(const Radian &angle)
Sets the maximum angle away from the emitter direction which particle will be emitted.
virtual void setMaxTimeToLive(Real max)
Sets the maximum time each particle will live for.
Command object for particle emitter - see ParamCommand.
virtual void genEmissionVelocity(Vector3 &destVector)
Internal utility method to apply velocity to a particle direction.
Copyright © 2012 Torus Knot Software Ltd

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