class
ParticleModule
Base interface for particle modules
- Module
- Particles
- Header
#include "Particles/ParticleModule.h"- Namespace
Mowo
Properties
| Type | Name | Description |
|---|---|---|
bool | enabled | Default true. |
Vec3 | emitterPosition | World position of the owning emitter for the frame being simulated, refreshed by ParticleSystem before the module pass. Modules whose motion is defined relative to the emitter read it from here — the per-particle update signature carries no emitter context. Default Vec3(0.0f, 0.0f, 0.0f). |
const ParticleCollisionField* | collisionField | The frame's collision field, refreshed alongside emitterPosition and owned by the caller. Null whenever the scene exposes no collidable representation, which every module must tolerate. Default nullptr. |
Constructors
| Signature | Name | Description |
|---|---|---|
virtual ~ParticleModule() = default | ~ParticleModule |
Public functions
| Returns | Name | Description |
|---|---|---|
void | OnSpawn | Called when a particle is spawned |
void | OnUpdate | Called every frame for each alive particle |
void | OnUpdateRange | Called once per frame with the whole alive range (module-outer / particle-inner — one dispatch per module, tight vectorizable inner loops). |
void | OnPostIntegrate | Called once per frame AFTER the integration step, with positions the frame will actually render. |
const char* | GetTypeName | Module type name for serialization |
Scope<ParticleModule> | Clone | Clone for copying emitters |
Scope<ParticleModule> | CreateParticleModule |
Function details
~ParticleModule
C++
virtual ~ParticleModule() = defaultOnSpawn
C++
virtual void OnSpawn(Particle& particle, ParticleRandom& random, const Vec3& emitterPos)Called when a particle is spawned
OnUpdate
C++
virtual void OnUpdate(Particle& particle, float deltaTime, float normalizedAge)Called every frame for each alive particle
OnUpdateRange
C++
virtual void OnUpdateRange(Particle* particles, size_t count, float deltaTime, const float* normalizedAges)Called once per frame with the whole alive range (module-outer / particle-inner — one dispatch per module, tight vectorizable inner loops). Default forwards to per-particle OnUpdate so external modules keep working; built-in modules override with statically-bound loops.
OnPostIntegrate
C++
virtual void OnPostIntegrate(Particle* particles, size_t count, float deltaTime)Called once per frame AFTER the integration step, with positions the frame will actually render. Collision belongs here: run inside the module pass it would resolve against pre-integration positions and let every particle tunnel one frame's travel into the geometry it just hit.
GetTypeName
C++
virtual const char* GetTypeName() const = 0Module type name for serialization
Clone
C++
virtual Scope<ParticleModule> Clone() const = 0Clone for copying emitters
CreateParticleModule
C++
static Scope<ParticleModule> CreateParticleModule(const std::string& typeName)Generated from Particles/ParticleModule.h via particles.json · Oct 31, 2026Version 1.0.0