class
ParticleScene
Keeps track of all active ParticleSystems in a particular scene and performs per-frame updates.
Public
Constructors
Methods
~ParticleScene
SetOwner
Set the owning scene instance.
Must be called after construction.
Update
Advances the simulation for all particle systems using the current frame time delta.
Outputs a set of data that can be used for rendering
& updating every active particle system.
Play
Starts or resumes the particle system.
New particles will be emitted and existing particles will be evolved.
Pause
Pauses the particle system.
New particles will stop being emitted and existing particle state will be frozen.
Stop
Stops the particle system and resets it to initial state, clearing all particles.
CalculateBounds
Calculate current particle bounds.
AllocateId
Allocates a unique particle system ID.
Used by the ParticleSystem component and ECS-only users.
Private
Methods
PreSimulate
Decrements particle lifetime, kills expired particles and executes evolvers that need to run before the simulation.
- state
- State describing the current state of the simulation.
- startIndex
- Index of the first particle to update.
- count
- Number of particles to update, starting from .
- spacing
- When false all particles will use the same time-step. If true the time-step will be divided by so particles are uniformly distributed over the time-step.
- spacingOffset
- Extra offset that controls the starting position of the first particle when calculating spacing. Should be in range [0, 1). 0 = beginning of the current time step, 1 = start of next particle.
Simulate
Simulates particle properties, advancing the simulation.
- state
- State describing the current state of the simulation.
- startIndex
- Index of the first particle to update.
- count
- Number of particles to update, starting from .
- spacing
- When false all particles will use the same time-step. If true the time-step will be divided by so particles are uniformly distributed over the time-step.
- spacingOffset
- Extra offset that controls the starting position of the first particle when calculating spacing. Should be in range [0, 1). 0 = beginning of the current time step, 1 = start of next particle.
PostSimulate
Executes evolvers that need to run after the simulation.
- state
- State describing the current state of the simulation.
- startIndex
- Index of the first particle to update.
- count
- Number of particles to update, starting from .
- spacing
- When false all particles will use the same time-step. If true the time-step will be divided by so particles are uniformly distributed over the time-step.
- spacingOffset
- Extra offset that controls the starting position of the first particle when calculating spacing. Should be in range [0, 1). 0 = beginning of the current time step, 1 = start of next particle.
AdvanceSimulation
Advances the simulation for a single particle system by the given time delta.
Handles emitting, evolving, and integrating all particles.
SortParticles
Sorts the particles in the provided the .
Sorted particle indices are placed in the
array which is expected to be pre-allocated with enough space to hold an index for each particle in a set. is used as a reference point when using the Distance sort mode.