Particle Emitters
From Multiverse
Emitter types
Particle emitters are classified by the shape of the area from which the particles emanate, for example, for a Point emitter, the particles come from a single point, while for a Box emitter, the particles come randomly from an cubical area. Emitter names (Point, Box, and so on) are case-sensitive.
Create an emitter with a section like this in the particle script:
emitter type
{
attribute value
attribute value
...
}
Where type is one of:
- Point
- Box
- Cylinder
- Ellipsoid
- Hollow Ellipsoid
- Ring
All types of emitters share a common set of attributes. Some emitter types also have additional attributes, described below.
For example:
emitter Box
{
angle 30
emission_rate 30
time_to_live 5
direction 0 1 0
velocity 0
colour_range_start 1 1 0
colour_range_end 0.3 1 0.3
width 600
height 600
depth 600
}
Point
A Point emitter emits particles from a single point, its position. This emitter has no attributes other than the standard emitter attributes.
Box
A Box emitter emits particles from a random location within a cube. The following table describes its additional attributes:
| Attribute | Description | Default Value | Example |
|---|---|---|---|
| width units | Width of the box, the size of the box along its local X axis, which is dependent on the direction attribute that forms the box's local Z. | 100 | width 250 |
| height units | Height of the box, the size of the box along its local Y axis, which is dependent on the direction attribute that forms the box's local Z. | 100 | height 250 |
| depth units | Depth of the box, the size of the box along its local Z axis, which is the same as the direction attribute. | 100 | depth 250 |
Cylinder
A Cylinder emitter emits particles in a random direction from within a cylindrical area oriented along the Z-axis. This emitter has the same additional attributes as the Box emitter. The width and height determine the shape of the cylinder along its axis (if they are different, it is an ellipsoid cylinder) and the depth determines the length of the cylinder.
Ellipsoid
An Ellipsoid emitter emits particles from within an ellipsoid shaped area, a sphere or "squashed sphere." The parameters are again identical to the Box Emitter, except that the dimensions describe the widest points along each of the axes.
Hollow Ellipsoid
A Hollow Ellipsoid emitter is just like Ellipsoid emitter except that there is a hollow area in the center of the ellipsoid from which it does not emit particles. Therefore it has three additional attributes:
- inner_width: The width of the inner area which does not emit any particles.
- inner_height: The height of the inner area which does not emit any particles.
- inner_depth: The depth of the inner area which does not emit any particles.
Ring
A Ring emitter emitter emits particles from a ring-shaped area, similar to a Hollow Ellipsoid Emitter except in two dimensions. It has two additional attributes:
- inner_width: The width of the inner area which does not emit any particles.
- inner_height: The height of the inner area which does not emit any particles.
Emitter common attributes
This section describes the common attributes of all particle emitters. Some emitter types may have additional attributes.
| Attribute | Valid Values | Default Value | Example |
|---|---|---|---|
| angle degrees | Integer (degrees) | 0 | angle 30 |
| colour r g b [a] | Three or four numbers between zero and one, for red, green, blue, and optionally alpha values. | 1 1 1 1 | colour 1 0 0 1 |
| colour_range_start r g b colour_range_end r g b | Three numbers between zero and one, for red, green, blue values. | 1 1 1 1 | colour_range_end 0 0 1 (generates random colours between red and blue) |
| direction x y z | Three-dimensional unit vector (riplet of zeros or ones) | 1 0 0 | direction 0 1 0 |
| duration seconds | Positive integer | 0 | duration 2.5 |
| duration_min seconds duration_max seconds | Positive integer | Both 0 | duration_min 2 duration_max 5 |
| emission_rate particles_per_second | Positive integer | 10 | emission_rate 50 |
| position x y z | Triplet of real numbers | 0 0 0 | position 10 0 40 |
| repeat_delay seconds | Positive integer | 0 | repeat_delay 2.5 |
| repeat_delay_min seconds repeat_delay_max seconds | Positive integer | Both 0 | repeat_delay 2 repeat_delay 5 |
| time_to_live seconds | Positive integer | 5 | time_to_live 10 |
| time_to_live_min seconds time_to_live_max seconds | Positive integer | Both 5 | time_to_live_min 2 time_to_live_max 5 |
| velocity world_units_per_second | Non-negative real number | 1 | velocity 100 |
| velocity_min value velocity_max value | Non-negative real number | Both 1 | velocity_min 50 velocity_max 100 |
angle
Sets the maximum angle (in degrees) which emitted particles may deviate from the direction of the emitter (see direction). Setting this to 10 allows particles to deviate up to 10 degrees in any direction away from the emitter's direction. A value of 180 means emit in any direction, whilst 0 means emit always exactly in the direction of the emitter.
colour
Sets a static colour for all particle emitted. Also see the colour_range_start and colour_range_end attributes for setting a range of colours. The format of the colour parameter is "r g b a", where each component is a value from 0 to 1, and the alpha value is optional (assumes 1 if not specified).
colour_range_start, colour_range_end
As the 'colour' attribute, except these 2 attributes must be specified together, and indicate the range of colours available to emitted particles. The actual colour will be randomly chosen between these 2 values.
direction
Sets the direction of the emitter. This is relative to the SceneNode which the particle system is attached to, meaning that as with other movable objects changing the orientation of the node will also move the emitter.
duration
Sets the number of seconds the emitter is active. The emitter can be started again, see repeat_delay. A value of 0 means infinite duration. See also the duration_min and duration_max attributes which let you set a duration range instead of a fixed one.
duration_min, duration_max
These attributes are the same as duration, except these attributes set a variable time range between the min and max values each time the emitter is started.
emission_rate
Sets how many particles per second should be emitted. The specific 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, the behaviour depends on the emitter. The emission rate will also be limited by the particle system's 'quota' setting.
position
Sets the position of the emitter relative to the SceneNode the particle system is attached to.
repeat_delay
Sets the number of seconds to wait before the emission is repeated when stopped by a limited duration. See also the repeat_delay_min and repeat_delay_max attributes which allow you to set a range of repeat_delays instead of a fixed one.
repeat_delay_min, repeat_delay_max
As repeat_delay, except this sets a range of repeat delays and each time the emitter is started it gets a random value inbetween.
time_to_live
Sets the number of seconds each particle will 'live' for before being destroyed. NB it is possible for particle affectors to alter this in flight, but this is the value given to particles on emission. See also the time_to_live_min and time_to_live_max attributes which let you set a lifetime range instead of a fixed one.
time_to_live_min, time_to_live_max
These attributes are the same as time_to_live, except they set a range of lifetimes and each particle gets a random value in between on emission.
velocity
Sets a constant velocity for all particles at emission time. See also the velocity_min and velocity_max attributes which allow you to set a range of velocities instead of a fixed one.
velocity_min and velocity_max
These attributes are the same as 'velocity' except they set a velocity range and each particle is emitted with a random velocity within this range.
This document is based on the OGRE Manual and is licensed under the Creative Commons Attribution-ShareAlike 2.5 License.
