Skip to content
party.js logoparty.js logo

ReferenceParticlesInterface

Particle

The state of a single particle.

The state of a single particle while it is alive.

Particles live in particle space, measured in pixels from the effect’s origin: +x points right, +y points up and +z points out of the screen towards the viewer. Particles are drawn without perspective, so the z-axis only matters for directions, not positions.

On every simulation step, the particle’s age advances first. If the particle is still alive, the behaviors run in the order they are listed in the effect. Then the particle is moved by velocity and rotated by angularVelocity. A particle is removed (i.e. it dies) once its age reaches its lifetime.

Each particle has its own copies of its vectors, color and shape, so behaviors can change them in place or replace them. The only exception is the path of a PathShape, which is shared with other particles possessing the same shape, so it should be replaced rather than modified.

agenumber

How long the particle has been alive, in seconds.

angularVelocityVec3

How fast the particle spins. The direction is the rotation axis (following the right-hand rule), and the length is the speed in degrees per second.

colorColor

The particle’s color, before lighting is applied.

lifetimenumber

How long the particle lives, in seconds. It’s removed (i.e. it dies) once age reaches this value.

orientationQuat

How the particle is rotated. With no rotation, the shape faces the viewer and is drawn exactly as its shape defines.

positionVec3

Where the particle is, in pixels from the effect’s origin, in particle space.

shapeParticleShape

The shape the particle is drawn as.

sizenumber

The particle’s size, in pixels. Its shape’s 1x1 box is scaled to this size.

velocityVec3

How fast the particle moves, in px/s. Applied to position on every step, after the behaviors have run.