ParticleEmitter
From oWiki
Attributes
i
int ( r )
The index of this ParticleEmitter.
Methods
setPosition( pos )
pos: Vector3
| Sets the position of this emitter relative to the particle system center. |
getPosition()
Return: Vector3
| Returns the position of this emitter relative to the center of the particle system. |
setDirection( dir )
dir: Vector3
| Sets the direction of the emitter. |
| Most emitters will have a base direction in which they emit particles (those which emit in all directions will ignore this parameter). They may not emit exactly along this vector for every particle, many will introduce a random scatter around this vector using the angle property. |
getDirection()
Return: Vector3
| Returns the direction of the emitter. |
setAngle( a )
a: float in degrees
| Sets the maximum angle away from the emitter direction which particle will be emitted. |
| While the direction property defines the general direction of emission for particles, this property defines how far the emission angle can deviate away from this base direction. This allows you to create a scatter effect - if set to 0, all particles will be emitted exactly along the emitters direction vector, whereas if you set it to 180 degrees or more, particles will be emitted in a sphere, i.e. in all directions. |
getAngle()
Return: float
| Returns the maximum angle which the initial particle direction can deviate from the emitters base direction. |
setRotation( a )
a: float in degrees
| Sets the current rotation of this emitter. |
getRotation()
Return: float
| Gets the current rotation of this emitter. |
setVelocity( min, max )
min: float
max: float (optional)
| Sets the initial velocity range of particles emitted. |
| This method sets the range of starting speeds for emitted particles. Sets max = null or simply skip max if you want a constant speed. This emitter will randomly choose a speed between the minimum and maximum for each particle. |
getVelocity()
Return: float
| Returns the initial velocity of particles emitted. |
getMinVelocity()
Return: float
| Returns the minimum particle velocity. |
getMaxVelocity()
Return: float
| Returns the maximum particle velocity. |
setEmissionRate( particlesPerSecond )
particlesPerSecond: float
| Sets the emission rate for this emitter. |
| This method tells the emitter how many particles per second should be emitted. The emitter does not have to emit these in a continuous burst - this is a relative parameter and the emitter may choose to emit all of the second's worth of particles every half-second for example. |
| Also, if the ParticleSystem's particle quota is exceeded, not all the particles requested may be actually emitted. |
getEmissionRate()
Return: float
| Gets the emission rate for this emitter. |
setTimeToLive( min, max )
min: float
max: float (optional)
| Sets the range of lifetime for particles emitted. |
| The emitter initializes particles with a time-to-live (TTL), the number of seconds a particle will exist before being destroyed. This method sets a range for the TTL for all particles emitted; the ttl may be randomized between these 2 extremes or will vary some other way depending on the emitter. Note that affectors are able to modify the TTL of particles later. |
| Sets max = null or simply skip max to have a constant TTL for all particles. |
getTimeToLive()
Return: float
| Gets the time each particle will live for. |
getMinTimeToLive()
Return: float
| Gets the minimum time each particle will live for. |
getMaxTimeToLive()
Return: float
| Gets the maximum time each particle will live for. |
setColor( color1, color2 )
color1: RGBA
color2: RGBA (optional)
| Sets the initial color range of particles emitted. |
| Particles have an initial color on emission which the emitter sets. This method sets the range of this color. Emitters may choose to randomly assign a color in this range, or may use some other method to vary the color. |
| Sets color2 = null or simply skip color2 in order to set a constant color for all particles. |
getColor()
Return: RGBA
| Gets the colour of particles to be emitted. |
getColorRangeStart()
Return: RGBA
| Gets the minimum colour of particles to be emitted. |
getColorRangeEnd()
Return: RGBA
| Gets the maximum colour of particles to be emitted. |
getType()
Return: string
| Returns the name of the type of emitter. |
setEnabled( b )
b: bool
| Sets whether or not the emitter is enabled. |
getEnabled()
Return: bool
| Returns whether or not this emitter is enabled. |
setStartTime( startTime )
startTime: float
| Sets the start time of this emitter. |
| By default an emitter starts straight away as soon as a ParticleSystem is first created, or also just after it is re-enabled. This parameter allows you to set a time delay so that the emitter does not 'kick in' until later. |
| startTime: The time in seconds from the creation or enabling of the emitter. |
getStartTime()
Return: float
| Gets the start time of the emitter. |
setDuration( min, max )
min: float
max: float (optional)
| Sets the range of random duration for this emitter. |
| By default emitters run indefinitely (unless you manually disable them). By setting this parameter, you can make an emitter turn off on it's own after a random number of seconds. It will then remain disabled until setEnabled(true) is called. |
| Sets max = null or simply skip max to have a constant duration. |
getDuration()
Return: float
| Gets the duration of the emitter from when it is created or re-enabled. |
getMinDuration()
Return: float
| Gets the minimum duration of this emitter in seconds. |
getMaxDuration()
Return: float
| Gets the maximum duration of this emitter in seconds. |
setRepeatDelay( min, max )
min: float
max: float (optional)
| Sets the number of seconds, randomly selected between [min, max], to wait before the emission is repeated when stopped by a limited duration. |
| Sets max = null or simply skip max to have a constant delay. |
getRepeatDelay()
Return: float
| Gets the duration of delay in seconds. |
getMinRepeatDelay()
Return: float
| Gets the minimum delay in seconds. |
getMaxRepeatDelay()
Return: float
| Gets the maximum delay in seconds. |
setName( name )
name: string
| Sets the name of the emitter. |
getName()
Return: string
| Gets the name of the emitter. |
setEmittedEmitter( name )
name: string
| Sets the name of the emitter to be emitted. |
getEmittedEmitter()
Return: string
| Returns the name of the emitter to be emitted. |
setDimensions( w, h )
w: float
h: float
| Sets the width and height for this particle. |
| Note that it is most efficient for every particle in a ParticleSystem to have the same dimensions. If you choose to alter the dimensions of an individual particle the set will be less efficient. Do not call this method unless you really need to have different particle dimensions within the same set. |
