class

ParticleModule

Base interface for particle modules

Module
Particles
Header
#include "Particles/ParticleModule.h"
Namespace
Mowo

Properties

TypeNameDescription
boolenabledDefault true.
Vec3emitterPositionWorld 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*collisionFieldThe 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

SignatureNameDescription
virtual ~ParticleModule() = default~ParticleModule

Public functions

ReturnsNameDescription
voidOnSpawnCalled when a particle is spawned
voidOnUpdateCalled every frame for each alive particle
voidOnUpdateRangeCalled once per frame with the whole alive range (module-outer / particle-inner — one dispatch per module, tight vectorizable inner loops).
voidOnPostIntegrateCalled once per frame AFTER the integration step, with positions the frame will actually render.
const char*GetTypeNameModule type name for serialization
Scope<ParticleModule>CloneClone for copying emitters
Scope<ParticleModule>CreateParticleModule

Function details

~ParticleModule

C++
virtual ~ParticleModule() = default

OnSpawn

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 = 0

Module type name for serialization

Clone

C++
virtual Scope<ParticleModule> Clone() const = 0

Clone 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