struct
ParticleEmitterComponent
- Module
- Particles
- Header
#include "Particles/Components/ParticleEmitterComponent.h"- Namespace
Mowo- Reflection
- Reflected by MowoHeaderTool
Properties
| Type | Name | Description |
|---|---|---|
bool | enabled | Default true. |
float | significance | Significance: when the emitter budget (r.Effects max active emitters, overdraw budget) bites, emitters are admitted by significance — this priority over distance — instead of nearest-first, so a far muzzle flash outranks near ambient dust. Always Relevant bypasses the budget entirely (the one effect a gameplay beat must not lose). Default 50.0f. |
bool | alwaysRelevant | Default false. |
bool | loop | Default true. |
float | duration | Duration of emission (if not looping) Default 5.0f. |
bool | playOnAwake | Default true. |
float | emissionRate | Particles per second Default 10.0f. |
uint32_t | maxParticles | Pool size Default Particles::DefaultMaxParticles. |
int | burstCount | Particles to emit at start Default 0. |
float | lifetimeMin | Default 1.0f. |
float | lifetimeMax | Default 2.0f. |
Vec3 | startVelocity | Start values (randomized between min/max) Default Vec3(0.0f, 1.0f, 0.0f). |
float | startSpeedMin | Default 1.0f. |
float | startSpeedMax | Default 2.0f. |
Vec2 | startSizeMin | Default Vec2(0.1f, 0.1f). |
Vec2 | startSizeMax | Default Vec2(0.2f, 0.2f). |
Vec4 | startColor | Default Vec4(1.0f, 1.0f, 1.0f, 1.0f). |
std::string | particlePath | Linked .particle asset. The modules vector below is runtime-only, so without this scene-authored module sets were lost on save/load. Scene deserialize re-clones the asset's modules onto the emitter (see Scene::DeserializeFromDocument), making authored particles persist. |
uint32_t | seed | Zero means "seed from the platform entropy source at pool init", i.e. a different effect every run. Any non-zero value makes the emitter reproducible across runs, machines and networked clients. Default 0. |
ParticleSimulationMode | simulationMode | Simulation mode handled by the custom (de)serialize hooks above. Default ParticleSimulationMode::CPU. |
ParticleRenderMode | renderMode | Billboard quads (default) or an instanced mesh per particle. Mesh mode submits through the scene's static-mesh path, so mesh particles are deferred-lit by the whole scene without a lit toggle. Default ParticleRenderMode::Billboard. |
std::string | meshPath | Mesh-mode source. A model asset ref wins; otherwise the primitive named by meshType is used (cube/sphere/cylinder/cone/capsule/torus/plane/quad), mirroring the MeshRenderer resolution contract. |
std::string | meshType | Default "cube". |
ParticleShadingMode | shadingMode | Billboard shading. Unlit keeps the classic emissive look; Lit runs a simplified forward loop (main directional N·L + ambient/GI) so smoke and dust sit in the scene's lighting. Mesh mode is always deferred-lit. Default ParticleShadingMode::Unlit. |
BillboardMode | billboardMode | Default BillboardMode::Camera. |
float | velocityStretch | Stretched billboard tuning. The quad's long axis aligns with the particle velocity and its length grows with speed: stretch = clamp(1 + speed * velocityStretch, 1, stretchMax). Only used when billboardMode is Stretched. Default 0.15f. |
float | stretchMax | Default 8.0f. |
ParticleBlendMode | blendMode | Default ParticleBlendMode::Alpha. |
bool | depthTest | Default true. |
std::string | texturePath | |
uint32_t | subUVColumns | Flipbook grid over the particle texture; the frame is picked from the particle's normalized age and baked into the quad UVs at submission. Default 1. |
uint32_t | subUVRows | Default 1. |
float | softFadeDistance | World-space distance over which a particle fades out as it approaches the opaque surface behind it. Zero keeps the hard depth clip. Default 0.0f. |
float | cullDistance | Distance past which the emitter stops submitting geometry (0 = never). Default 0.0f. |
UUID | textureID | Authored by the .particle asset; resolved to texture by the Scene. |
Ref<Image2D> | texture | |
std::string | resolvedTextureKey | |
Ref<GPUMesh> | mesh | Mesh-mode geometry resolved from meshPath/meshType by the Scene. |
std::string | resolvedMeshKey | |
std::vector<Scope<ParticleModule>> | modules | Modules (owned pointers) |
ParticlePool | pool | Runtime state (managed by ParticleSystem) |
ParticleRandom | random | |
float | emissionAccumulator | Default 0.0f. |
float | playbackTime | Default 0.0f. |
bool | isPlaying | Default false. |
bool | burstFired | Default false. |
bool | needsInitialization | Default true. |
bool | gpuModeWarned | Default false. |
void* | gpuState | GPU particle state (managed by GPUParticleRenderer, not serialized) Default nullptr. |
std::vector<Scope<ParticleEmitterComponent>> | children | The other emitters of a multi-emitter .vfx system and the children of this emitter's SubEmitter modules, owned here and simulated and drawn with it at its transform. Rebuilt from the asset whenever the scene resolves the emitter; never serialized. |
std::string | emitterName | The emitter's name inside its system, which SubEmitter modules address. |
bool | spawnFromEventsOnly | A sub-emitter child: no rate or burst of its own, it spawns only where its parent's events put particles. Default false. |
std::vector<FParticleEvent> | birthEvents | This frame's events, by EParticleEventType, filled only while a SubEmitter module listens for that type. |
std::vector<FParticleEvent> | deathEvents | |
std::vector<FParticleEvent> | collisionEvents | |
bool | gpuEventsWarned | Default false. |
bool | gpuExpressionWarned | Default false. |
Constructors
| Signature | Name | Description |
|---|---|---|
ParticleEmitterComponent() = default | ParticleEmitterComponent | Copy constructor needs special handling for unique_ptr |
ParticleEmitterComponent(const ParticleEmitterComponent& other) : enabled(other.… | ParticleEmitterComponent | Force re-init on copy |
ParticleEmitterComponent(ParticleEmitterComponent&&) = default | ParticleEmitterComponent |
Public functions
| Returns | Name | Description |
|---|---|---|
std::vector<FParticleEvent>& | Events | |
void | ForEachInTree | |
void | Play | |
void | Stop | |
void | Restart | |
void | Clear | |
size_t | GetParticleCount | |
bool | IsAlive | |
float | GetProgress | |
T* | AddModule | |
T* | GetModule | |
void | RemoveModule | |
void | InitializePool | |
void | CloneModulesFrom | Clone all modules (for prefab instantiation), and the child emitters with them: their SubEmitter slots index into this list. |
ParticleEmitterComponent& | operator= | |
ParticleEmitterComponent& | operator= |
Function details
ParticleEmitterComponent
C++
ParticleEmitterComponent() = defaultCopy constructor needs special handling for unique_ptr
ParticleEmitterComponent
C++
ParticleEmitterComponent(const ParticleEmitterComponent& other) : enabled(other.enabled), loop(other.loop), duration(other.duration), playOnAwake(other.playOnAwake), emissionRate(other.emissionRate), maxParticles(other.maxParticles), burstCount(other.burstCount), lifetimeMin(other.lifetimeMin), lifetimeMax(other.lifetimeMax), startVelocity(other.startVelocity), startSpeedMin(other.startSpeedMin), startSpeedMax(other.startSpeedMax), startSizeMin(other.startSizeMin), startSizeMax(other.startSizeMax), startColor(other.startColor), particlePath(other.particlePath), seed(other.seed), simulationMode(other.simulationMode), renderMode(other.renderMode), meshPath(other.meshPath), meshType(other.meshType), shadingMode(other.shadingMode), billboardMode(other.billboardMode), velocityStretch(other.velocityStretch), stretchMax(other.stretchMax), blendMode(other.blendMode), depthTest(other.depthTest), texturePath(other.texturePath), subUVColumns(other.subUVColumns), subUVRows(other.subUVRows), softFadeDistance(other.softFadeDistance), cullDistance(other.cullDistance), textureID(other.textureID), texture(other.texture), resolvedTextureKey(other.resolvedTextureKey), needsInitialization(true) , emitterName(other.emitterName), spawnFromEventsOnly(other.spawnFromEventsOnly)Force re-init on copy
ParticleEmitterComponent
C++
ParticleEmitterComponent(ParticleEmitterComponent&&) = defaultEvents
C++
std::vector<FParticleEvent>& Events(EParticleEventType type)ForEachInTree
C++
template<typename Fn> void ForEachInTree(Fn&& fn)Play
C++
void Play()Stop
C++
void Stop()Restart
C++
void Restart()Clear
C++
void Clear()GetParticleCount
C++
size_t GetParticleCount() constIsAlive
C++
bool IsAlive() constGetProgress
C++
float GetProgress() constAddModule
C++
template<typename T, typename... Args> T* AddModule(Args&&... args)GetModule
C++
template<typename T> T* GetModule()RemoveModule
C++
void RemoveModule(size_t index)InitializePool
C++
void InitializePool()CloneModulesFrom
C++
void CloneModulesFrom(const ParticleEmitterComponent& other)Clone all modules (for prefab instantiation), and the child emitters with them: their SubEmitter slots index into this list.
operator=
C++
ParticleEmitterComponent& operator=(const ParticleEmitterComponent& other)operator=
C++
ParticleEmitterComponent& operator=(ParticleEmitterComponent&&) = defaultGenerated from Particles/Components/ParticleEmitterComponent.h via particles.json · Oct 31, 2026Version 1.0.0