Particles module — factory + script binding. Per-frame: scheduler step → config reload → ParticleSimSystem → ParticleRenderSystem. advance(SimulationStep) is the deterministic entry; update(float) remains a compatibility facade that explicitly consumes its Result. CPU particle integration is deterministic for fixed seed/tick within float integration tolerance; resident GPU integration is tolerance-bounded and may expose a backend-specific observable particle count.
更多...
#include <Particles.h>
Public 成员函数 | |
| Module_REG (Particles) | |
| Particles () | |
| Particles. | |
| ~Particles () override | |
| Particles. | |
| ParticleEmitter * | newEmitter (int bufferSize=1000) |
| Creates a emitter. @ownership Caller deletes unless documented otherwise. | |
| ParticleEmitter * | newEmitterFromFile (const std::string &path) |
| Create emitter from JSON config file (reads optional "buffer"). | |
| ParticleEffect * | newEffectFromText (const std::string &json) |
| Create a versioned multi-emitter effect from JSON text. | |
| ParticleEffect * | newEffectFromFile (const std::string &path) |
| Create a versioned multi-emitter effect asset from a JSON file. | |
| std::string | getLastEffectError () const |
| Return the latest effect asset parse or load error. | |
| eve::Result< void > | advance (const eve::SimulationStep &step) |
| Advance simulation from an injected scheduler step. | |
| void | update (float dt) |
| Legacy seconds facade; invalid conversion/step is explicitly consumed. | |
| void | render (graphics::Graphics *gfx) |
| Renders . | |
| int | pollConfigs () |
| Explicit hot-reload poll; also invoked from update(). | |
| int | getEmitterCount () const |
| Returns the emitter count. | |
| void | setBudget (int maxParticles, int maxSimulatedEmitters) |
| Set global soft particle and simulated-emitter budgets; zero is unlimited. | |
| int | getMaxParticles () const |
| Return the global live-particle soft cap, or zero when unlimited. | |
| int | getMaxSimulatedEmitters () const |
| Return the per-frame simulated-emitter cap, or zero when unlimited. | |
| void | setQualityLevel (int quality) |
| Select the runtime VFX quality tier in [0,3]. | |
| int | getQualityLevel () const |
| Return the current runtime VFX quality tier. | |
| int | getLastSimulatedEmitters () const |
| Return emitters simulated during the last update. | |
| int | getLastCulledEmitters () const |
| Return emitters skipped by culling during the last update. | |
| int | getLastBudgetSkippedEmitters () const |
| Return emitters skipped by quality or capacity budgets. | |
| int | getLastParticleCount () const |
| Return live particles after the last update. | |
| int | getLastSpawnedParticles () const |
| Return particles spawned during the last update. | |
| int | getLastDroppedSpawns () const |
| Return automatic spawns dropped by budget during the last update. | |
| int | getLastGpuResidentEmitters () const |
| Return emitters using the resident GPU backend after the last update. | |
| int | getLastGpuResidentParticles () const |
| Return the CPU lifetime estimate for resident GPU particles. | |
| int | getLastRenderedParticles () const |
| Return particles submitted during the last render. | |
| float | getLastSimulationMs () const |
| Return CPU simulation wall time in milliseconds. | |
| float | getLastRenderMs () const |
| Return particle render-build and submission wall time in milliseconds. | |
Public 成员函数 继承自 eve::Module | |
| virtual | ~Module () |
| Module. | |
| virtual std::string | getName () const =0 |
| Returns the name. | |
详细描述
Particles module — factory + script binding. Per-frame: scheduler step → config reload → ParticleSimSystem → ParticleRenderSystem. advance(SimulationStep) is the deterministic entry; update(float) remains a compatibility facade that explicitly consumes its Result. CPU particle integration is deterministic for fixed seed/tick within float integration tolerance; resident GPU integration is tolerance-bounded and may expose a backend-specific observable particle count.
在文件 Particles.h 第 28 行定义.
构造及析构函数说明
◆ Particles()
| eve::particles::Particles::Particles | ( | ) |
◆ ~Particles()
|
override |
成员函数说明
◆ advance()
| eve::Result< void > eve::particles::Particles::advance | ( | const eve::SimulationStep & | step | ) |
Advance simulation from an injected scheduler step.
在文件 Particles.cpp 第 88 行定义.
引用了 eve::particles::ParticleSimSystem::advance(), eve::particles::ParticleEffect::advanceRegisteredTimelines(), eve::Applied, eve::Result< T >::failure(), eve::particles::ParticleConfigSystem::poll(), step, eve::Status::success(), eve::Result< T >::success() , 以及 eve::particles::ParticleLightSystem::update().
◆ getEmitterCount()
| int eve::particles::Particles::getEmitterCount | ( | ) | const |
◆ getLastBudgetSkippedEmitters()
| int eve::particles::Particles::getLastBudgetSkippedEmitters | ( | ) | const |
Return emitters skipped by quality or capacity budgets.
在文件 Particles.cpp 第 139 行定义.
引用了 eve::particles::particleFrameStats() , 以及 stats.
◆ getLastCulledEmitters()
| int eve::particles::Particles::getLastCulledEmitters | ( | ) | const |
Return emitters skipped by culling during the last update.
在文件 Particles.cpp 第 138 行定义.
引用了 eve::particles::ParticleFrameStats::emittersCulled , 以及 eve::particles::particleFrameStats().
◆ getLastDroppedSpawns()
| int eve::particles::Particles::getLastDroppedSpawns | ( | ) | const |
Return automatic spawns dropped by budget during the last update.
在文件 Particles.cpp 第 145 行定义.
引用了 eve::particles::ParticleFrameStats::droppedSpawns , 以及 eve::particles::particleFrameStats().
◆ getLastEffectError()
|
inline |
Return the latest effect asset parse or load error.
在文件 Particles.h 第 45 行定义.
◆ getLastGpuResidentEmitters()
| int eve::particles::Particles::getLastGpuResidentEmitters | ( | ) | const |
Return emitters using the resident GPU backend after the last update.
在文件 Particles.cpp 第 146 行定义.
引用了 eve::particles::ParticleFrameStats::gpuResidentEmitters , 以及 eve::particles::particleFrameStats().
◆ getLastGpuResidentParticles()
| int eve::particles::Particles::getLastGpuResidentParticles | ( | ) | const |
Return the CPU lifetime estimate for resident GPU particles.
在文件 Particles.cpp 第 147 行定义.
引用了 eve::particles::ParticleFrameStats::gpuResidentParticles , 以及 eve::particles::particleFrameStats().
◆ getLastParticleCount()
| int eve::particles::Particles::getLastParticleCount | ( | ) | const |
Return live particles after the last update.
在文件 Particles.cpp 第 143 行定义.
引用了 eve::particles::particleFrameStats() , 以及 eve::particles::ParticleFrameStats::particlesAfter.
◆ getLastRenderedParticles()
| int eve::particles::Particles::getLastRenderedParticles | ( | ) | const |
Return particles submitted during the last render.
在文件 Particles.cpp 第 148 行定义.
引用了 eve::particles::particleFrameStats() , 以及 eve::particles::ParticleFrameStats::renderedParticles.
◆ getLastRenderMs()
| float eve::particles::Particles::getLastRenderMs | ( | ) | const |
Return particle render-build and submission wall time in milliseconds.
在文件 Particles.cpp 第 150 行定义.
引用了 eve::particles::particleFrameStats() , 以及 eve::particles::ParticleFrameStats::renderMs.
◆ getLastSimulatedEmitters()
| int eve::particles::Particles::getLastSimulatedEmitters | ( | ) | const |
Return emitters simulated during the last update.
在文件 Particles.cpp 第 137 行定义.
引用了 eve::particles::ParticleFrameStats::emittersSimulated , 以及 eve::particles::particleFrameStats().
◆ getLastSimulationMs()
| float eve::particles::Particles::getLastSimulationMs | ( | ) | const |
Return CPU simulation wall time in milliseconds.
在文件 Particles.cpp 第 149 行定义.
引用了 eve::particles::particleFrameStats() , 以及 eve::particles::ParticleFrameStats::simulationMs.
◆ getLastSpawnedParticles()
| int eve::particles::Particles::getLastSpawnedParticles | ( | ) | const |
Return particles spawned during the last update.
在文件 Particles.cpp 第 144 行定义.
引用了 eve::particles::particleFrameStats() , 以及 eve::particles::ParticleFrameStats::particlesSpawned.
◆ getMaxParticles()
| int eve::particles::Particles::getMaxParticles | ( | ) | const |
Return the global live-particle soft cap, or zero when unlimited.
在文件 Particles.cpp 第 127 行定义.
引用了 eve::particles::ParticleBudgetConfig::maxParticles , 以及 eve::particles::particleBudgetConfig().
◆ getMaxSimulatedEmitters()
| int eve::particles::Particles::getMaxSimulatedEmitters | ( | ) | const |
Return the per-frame simulated-emitter cap, or zero when unlimited.
在文件 Particles.cpp 第 129 行定义.
引用了 eve::particles::ParticleBudgetConfig::maxSimulatedEmitters , 以及 eve::particles::particleBudgetConfig().
◆ getQualityLevel()
| int eve::particles::Particles::getQualityLevel | ( | ) | const |
Return the current runtime VFX quality tier.
在文件 Particles.cpp 第 135 行定义.
引用了 eve::particles::particleBudgetConfig() , 以及 eve::particles::ParticleBudgetConfig::qualityLevel.
◆ Module_REG()
| eve::particles::Particles::Module_REG | ( | Particles | ) |
◆ newEffectFromFile()
| ParticleEffect * eve::particles::Particles::newEffectFromFile | ( | const std::string & | path | ) |
Create a versioned multi-emitter effect asset from a JSON file.
在文件 Particles.cpp 第 75 行定义.
◆ newEffectFromText()
| ParticleEffect * eve::particles::Particles::newEffectFromText | ( | const std::string & | json | ) |
Create a versioned multi-emitter effect from JSON text.
在文件 Particles.cpp 第 70 行定义.
◆ newEmitter()
| ParticleEmitter * eve::particles::Particles::newEmitter | ( | int | bufferSize = 1000 | ) |
Creates a emitter. @ownership Caller deletes unless documented otherwise.
在文件 Particles.cpp 第 45 行定义.
◆ newEmitterFromFile()
| ParticleEmitter * eve::particles::Particles::newEmitterFromFile | ( | const std::string & | path | ) |
Create emitter from JSON config file (reads optional "buffer").
在文件 Particles.cpp 第 47 行定义.
引用了 buffer, eve::particles::ParticleEmitter::createEmitter(), eve::particles::loadConfigFile(), path , 以及 text.
◆ pollConfigs()
| int eve::particles::Particles::pollConfigs | ( | ) |
Explicit hot-reload poll; also invoked from update().
在文件 Particles.cpp 第 111 行定义.
◆ render()
| void eve::particles::Particles::render | ( | graphics::Graphics * | gfx | ) |
◆ setBudget()
| void eve::particles::Particles::setBudget | ( | int | maxParticles, |
| int | maxSimulatedEmitters | ||
| ) |
Set global soft particle and simulated-emitter budgets; zero is unlimited.
在文件 Particles.cpp 第 121 行定义.
◆ setQualityLevel()
| void eve::particles::Particles::setQualityLevel | ( | int | quality | ) |
Select the runtime VFX quality tier in [0,3].
在文件 Particles.cpp 第 131 行定义.
引用了 eve::particles::particleBudgetConfig() , 以及 eve::particles::ParticleBudgetConfig::qualityLevel.
◆ update()
| void eve::particles::Particles::update | ( | float | dt | ) |
Legacy seconds facade; invalid conversion/step is explicitly consumed.
在文件 Particles.cpp 第 80 行定义.
引用了 EV_PROFILE_MODULE, eve::particles::ParticleConfigSystem::poll(), eve::particles::ParticleEffect::tickRegisteredTimelines(), eve::particles::ParticleLightSystem::update() , 以及 eve::particles::ParticleSimSystem::update().
该类的文档由以下文件生成:
- src/modules/particles/Particles.h
- src/modules/particles/Particles.cpp
Public 成员函数 继承自