Creates a simple particle system. When active, it will begin creating and emitting particles from the parent.
Category
Latest Behaviors
Author
Gavin Kistner
Difficulty
(Reference)
Time to Complete
5 Minutes
Downloads
Click Here
to download the associated files.
(This document covers version 2.4.3 of the 'Particle Emitter' behavior, current as of 2005-Feb-23)
Description
Attach this behavior to a model to create ‘particles’ from that model, creating copies of it and ejecting them in a direction. While the behavior of the particles can be extended with other behaviors (see below), the Particle Emitter behavior has built-in gravity and (rudimentary) floor collisions.
So that the emitter particle (the parent of this behavior) may be dynamically transformed without affecting the particles, the created particles are placed in global space, attached to the same layer as the parent object is in.
Properties
The
Particle Count
property controls the maximum number of particles active in the scene at any time. More particles looks cooler, but may slow down your presentation. Further, as only one particle is created each frame, there is a limit to the number of particles which can be created within a given lifespan for particles.
If the
Show Source?
property is checked, the original object will be left in the scene. If unchecked (the default), the parent object will not be shown, only the copies created by this behavior.
The
Emitter Direction
property is a vector in the
local
coordinate system of the object which specifies the side of the object that particles should shoot from. The default setting of [0 1 0] specifies that particles will come out of the ‘top’ (+y) of the parent model.
The
Emitter Force
property specifies the initial velocity of the particles (measured in units/second).
The
Emitter Spread
property specifies an amount of ‘spray’ for the particles. A value of 0 will cause the particles to come out in a perfect stream, while a value of 1 will cause them to spray in a very wide angle (centered about the
Emitter Direction
).
The
Emitter Radius
property causes the particles to start in a random area around the parent object. A value of 0 will cause all particles to start in the same location as the parent of this behavior, while larger values will cause each particle to start in a random location in the starting plane, up to the distance specified by this property. (The bounding area from which the particles emit is actually a square, and not a circle, but ‘Emitter Radius’ is a much shorter name than ‘Length of the Sides of the Square from which the Particles can Emit’.)
The
Base Lifespan
property is the minimum number of seconds that each particle will exist before disappearing. A random amount up to
Lifespan Variation
is added to this value for each particle to determine how long it will be in the scene. It is recommended that you use a non-zero value for
Lifespan Variation
. If you set
Lifespan Variation
to 0, each particle will stay around for
Base Lifespan
seconds; if all the particles are used up before this time is reached, your particle emitter will pulse, spitting out every particle it can for a period, and then spitting out no particles while it waits for a new particle to ‘die’. By introducing randomness into the lifespans of the particles, your particle emitter will quickly get a semi-even distribution of particles.
The
Particle Roll
property sets up an initial rotation velocity for each particle as it comes out of the emitter.
If
Size Variation
is greater than zero, each particle created will be a slightly different size. The larger the value for
Size Variation
, the greater the variety of initial sizes.
If
Change Scale?
is checked, each particle will change in size over the course of its lifetime, from its initial size to a scaled size set by
End Scale
. If
End Scale
is 2, each particle will slowly grow to twice its size over the course of its life. Conversely, if
End Scale
is 0.1, each particle will shrink to be 1/10th the size that it started at.
If
Fade Particles?
is checked, each particle will slowly fade out (decrease in opacity) over the course if its lifetime. This provides a softer transition instead of having the particles ‘pop’ out of existence when their lifespan is complete.
If
Use Gravity?
is checked, each particle will be constantly accelerated in the direction specified by
Gravity Direction
with the amount of pull specified by
Gravity Force
. (The magnitude of
Gravity Direction
does not affect the pull on the particles.)
If
Use Floor?
is checked, the particles will run into a floor on their way down. The floor is specified in global space as an XZ plane at a specific height (the
Floor Height
property). The floor makes sure that all particles are above it at all times—you cannot use the floor to have particles bounce down off of a ceiling. Every time a particle hits the floor, it slows down by an amount specified by
Floor Bounce
. If this is set to 0, particle running into the floor will come to an immediate stop. If it is set to 1, the particles will experience a fully elastic collision, bouncing off at the same speed as they hit the floor.
Interaction with Other Behaviors
It is common to want to put one or more behaviors on each particle that is created, without having that behavior affect the emitter particle. To accommodate this desire, attaching behaviors
to the Particle Emitter behavior
will apply those behaviors to each particle that is created, without having them affect the emitter particle itself. For example, you may want to attach the Billboard behavior to this behavior so that all created particles rotate to face the camera.
Note that when you do this, a new copy of each attached behavior is attached to each particle.
Basic Properties
Particle Count
Total number of particles to create.
When Active
When is this behavior active?
Trigger Key
If 'When Active' is 'Key Down', the name of the key to watch for.
Revert?
Make behavior inactive when the 'opposite' event occurs?
Advanced Properties
Show Source?
Specifies if the parent object (emitter) will be visible.
Emitter Direction
The local direction that the particles will start emitting
Emitter Force
Speed and force particles will be emitted upward (higher number = stronger)
Emitter Spread
Particle spray angle of the emitter (lower number = stream, high number = spray)
Emitter Radius
Random distance from the source that particles start
Base Lifespan
Number of seconds that each particle will exist (higher number = long life)
Lifespan Variation
Maximum random number of seconds added to the Lifespan
Particle Roll
Rotation velocity of each particle during its lifespan (x,y,z degrees)
Size Variation
Amount to vary the initial size of each particle.
Change Scale?
Change the scale of the object over its life?
End Scale
End size of the particles, as a factor of the initial size.
Fade Particles?
Should particles fade to transparent over the lifespan?
Use Gravity?
Should particles be pulled in the Gravity Direction?
Gravity Direction
Global direction for gravity.
Gravity Force
The force (in units/second/second) that gravity exerts.
Use Floor?
Use an absolute floor for the particles to hit?
Floor Height
The world-space y value of the floor.
Floor Bounce
Amount of bounce the particles have on the floor.
Actions
Start
Start applying this behavior.
Stop
Stop applying this behavior.
Toggle
If the behavior is being applied, stop it; otherwise, start it.