class ParticleEmitter

Inherits: ParticleModule

Handles spawning of new particles using the specified parameters and shape.

Public

Methods

SetShape

void SetShape(SPtr<ParticleEmitterShape> shape)

Shape over which to emit the particles.

GetShape

const SPtr<ParticleEmitterShape> &GetShape() const

SetEmissionRate

void SetEmissionRate(FloatDistribution value)

Determines the number of particles that are emitted every second.

GetEmissionRate

const FloatDistribution &GetEmissionRate() const

SetEmissionBursts

void SetEmissionBursts(Vector<ParticleBurst> bursts)

Determines discrete intervals to emit particles.

GetEmissionBursts

const Vector<ParticleBurst> &GetEmissionBursts() const

SetInitialLifetime

void SetInitialLifetime(FloatDistribution value)

Determines the lifetime of particles when they are initially spawned, in seconds.

GetInitialLifetime

const FloatDistribution &GetInitialLifetime() const

SetInitialSpeed

void SetInitialSpeed(FloatDistribution value)

Sets the initial speed of the particles, in meters/second.

The speed is applied along the particle's velocity direction, which is determined by the emission shape and potentially other properties.

GetInitialSpeed

const FloatDistribution &GetInitialSpeed() const

SetInitialSize

void SetInitialSize(FloatDistribution value)

Determines the size of the particles when initially spawned.

The size is applied uniformly in all dimensions. Only used if 3D size is disabled.

GetInitialSize

const FloatDistribution &GetInitialSize() const

SetInitialSize3D

void SetInitialSize3D(Vector3Distribution value)

Determines the size of the particles when initially spawned.

Size can be specified for each dimension separately. Only used if 3D size is enabled.

GetInitialSize3D

const Vector3Distribution &GetInitialSize3D() const

SetUse3DSize

void SetUse3DSize(bool value)

Determines should the initial particle size be applied uniformly (if disabled), or evaluated separately for each dimension (if enabled).

GetUse3DSize

bool GetUse3DSize() const

SetInitialRotation

void SetInitialRotation(FloatDistribution value)

Determines the rotation of the particles when initially spawned, in degrees.

The rotation is applied around the particle's local Z axis. Only used if 3D rotation is disabled.

GetInitialRotation

const FloatDistribution &GetInitialRotation() const

SetInitialRotation3D

void SetInitialRotation3D(Vector3Distribution value)

Determines the rotation of the particles when initially spawned, in Euler angles.

Only used if 3D rotation is enabled.

GetInitialRotation3D

const Vector3Distribution &GetInitialRotation3D() const

SetUse3DRotation

void SetUse3DRotation(bool value)

Determines should the initial particle rotation be a single angle applied around a Z axis (if disabled), or a set of Euler angles that allow you to rotate around every axis (if enabled).

GetUse3DRotation

bool GetUse3DRotation() const

SetInitialColor

void SetInitialColor(const ColorDistribution &value)

Determines the initial color (in RGB channels) and transparency (in A channel) of particles.

GetInitialColor

const ColorDistribution &GetInitialColor() const

SetRandomOffset

void SetRandomOffset(float value)

Determines a range of values determining a random offset to apply to particle position after it has been emitted.

Offset will be randomly selected in all three axes in range [-value, value].

GetRandomOffset

float GetRandomOffset() const

SetFlipU

void SetFlipU(float value)

Determines should particle U texture coordinate be randomly flipped, mirroring the image.

The value represents a percent of particles that should be flipped, in range [0, 1].

GetFlipU

float GetFlipU() const

SetFlipV

void SetFlipV(float value)

Determines should particle V texture coordinate be randomly flipped, mirroring the image.

The value represents a percent of particles that should be flipped, in range [0, 1].

GetFlipV

float GetFlipV() const

staticCreate

static SPtr<ParticleEmitter> Create()

Creates a new emitter.

staticGetRttiStatic

static RTTIType *GetRttiStatic()

GetRtti

RTTIType *GetRtti() const override

Returns an interface you can use to access class' Run Time Type Information.

Private

Methods

Spawn

void Spawn(Random &random, const ParticleSystemState &state, ParticleSet &set) const

Spawns new particles in the specified time increment (if any).

random
Random number generator.
state
Various per-frame information provided by the parent particle system.
set
Set to which to append new particles to.

Spawn

u32 Spawn(u32 count, Random &random, const ParticleSystemState &state, ParticleSet &set, bool spacing) const

Spawns the specified number of particles.

count
Number of particles to spawn.
random
Random number generator.
state
Various per-frame information provided by the parent particle system.
set
Set to which to append new particles to.
spacing
When false all particles will use the current emitter time. When true the particles will be assigned a time between current time and time step end time, so they are unifomly distributed in this time range.

Returns: Actual number of spawned particles.

Fields

mShape

mEmissionRate

FloatDistribution mEmissionRate

mBursts

Vector<ParticleBurst> mBursts

mInitialLifetime

FloatDistribution mInitialLifetime

mInitialSpeed

FloatDistribution mInitialSpeed

mInitialSize

FloatDistribution mInitialSize

mInitialSize3D

Vector3Distribution mInitialSize3D

mUse3DSize

bool mUse3DSize

mInitialRotation

FloatDistribution mInitialRotation

mInitialRotation3D

Vector3Distribution mInitialRotation3D

mUse3DRotation

bool mUse3DRotation

mInitialColor

ColorDistribution mInitialColor

mFlipU

float mFlipU

mFlipV

float mFlipV

mRandomOffset

float mRandomOffset

mEmitAccumulator

float mEmitAccumulator

mBurstAccumulator

Vector<float> mBurstAccumulator