class ParticleEmitterShape

Base class from all emitter shapes.

Emitter shapes determine the position and direction of newly created particles.

Public

Methods

~ParticleEmitterShape

virtual ~ParticleEmitterShape() noexcept = default

Internal

Methods

SpawnInternal

virtual u32 SpawnInternal(const Random &random, ParticleSet &particles, u32 count, const ParticleSystemState &state) const = 0

Spawns a new set of particles using the current shape's distribution.

random
Random number generator.
particles
Particle set in which to insert new particles.
count
Number of particles to spawn.
state
Optional state that can contain various per-frame information required for spawning the particles.

Returns: Index at which the first of the particles was inserted, with other particles following sequentially.

Protected

Constructors

ParticleEmitterShape

ParticleEmitterShape() = default

Methods

CalcBounds

virtual void CalcBounds(AABox &shape, AABox &velocity) const = 0

Calculates the bounds of the emitter shape.

shape
AABB for the emitter shape itself.
velocity
AABB for the generated normals.

IsValid

bool IsValid() const

Checks has the emitter been initialized properly.

If the emitter is not valid then the spawn() method is not allowed to be called.

Fields

mIsValid

bool mIsValid