-
Notifications
You must be signed in to change notification settings - Fork 2
Particle system documentation
This page covers the ParticleSystem
class, along with all of the classes for particle spawn shapes.
This class represents a system of particles, and is responsible for detailing how the particles behave.
The constructor takes a single JavaScript object with the following properties:
Name | Type | Required? | Description |
---|---|---|---|
texture |
ParticleTexture |
Only if colour and additive are not provided. |
The texture for the particle texture atlas that should be used. |
colour |
Vector3f |
Only if texture is not provided. |
The colour of the particle, with normalised values (RGB is from 0-1). |
additive |
boolean |
Only if texture is not provided. |
True if additive blending should be used. |
spawn |
ParticleSpawn |
Yes | The spawn shape of the particles. |
rate |
float |
Yes | The number of particles spawned per second. |
speed |
float |
Yes | The average speed of each spawned particle. |
gravity |
float |
Yes | How much gravity affects each particle (1 is standard gravity). |
life |
float |
Yes | The average number of seconds that the particle is alive for. |
scale |
float |
Yes | The average scale of each particle. |
These spawns control how particles are spawned, and are responsible for defining the shape that they create.
Spawns particles in a circle.
The constructor takes two arguments: a Vector3f
defining the normal of the circle (the direction perpendicular to the circle's surface), and a float defining the radius. For example, new CircleSpawn(new Vector3f(0, 0, 1), 5)
creates a circle spawn with a radius of five that is parallel to the x-y plane.
Spawns particles in a cuboid shape.
The constructor takes a JavaScript object which can have the following properties:
Name | Type | Required? | Description |
---|---|---|---|
xScale |
float |
Yes | The scale of the cuboid in the x direction. |
yScale |
float |
Yes | The scale of the cuboid in the y direction. |
zScale |
float |
Yes | The scale of the cuboid in the z direction. |
yOffset |
float |
No | How high to offset the cuboid from the ground. |
Spawns particles in a line.
The constructor takes two arguments: a Vector3f
defining the direction of the line , and a float defining the length. For example, new CircleSpawn(new Vector3f(0, 1, 0), 5)
creates a line spawn with a length of five that is points straight up.
Spawns particles from a single point.
The constructor is empty, taking no arguments: new PointSpawn()
.
Spawns particles in a sphere shape.
The constructor takes a single float argument defining the radius of the sphere, e.g. new SphereSpawn(10)
creates a sphere of radius 10.
Thanks for visiting this wiki. Don't forget to check out Equilinox!
The wiki and the modding framework are still heavily under development, so not all content is available yet.