载入中...
搜索中...
未找到
eve::particles 命名空间参考

类

struct  ColorStop
 Color gradient stop at normalized lifetime t in [0, 1]. 更多...
 
struct  CurvePoint
 Scalar curve point at normalized lifetime t in [0, 1]. 更多...
 
struct  Particle
 Single live particle (CPU simulation). 更多...
 
struct  ParticleBudgetConfig
 Global particle scalability controls shared by CPU and future GPU backends. 更多...
 
class  ParticleConfigSystem
 Polls bound config files (Resource.path) and hot-reloads when modtime changes. Returns number of emitters reloaded. 更多...
 
class  ParticleCurve
 Multi-point scalar curve sampled with linear interpolation between points. Empty curve means "use the legacy two-point linear fallback". 更多...
 
class  ParticleEffect
 Runtime instance of a versioned, multi-emitter particle effect asset. 更多...
 
struct  ParticleEffectEventRoute
 One authored cross-emitter event route inside a particle effect asset. 更多...
 
struct  ParticleEffectTimeline
 Effect-level timeline controls (schema v2, optional on v1). 更多...
 
struct  ParticleEffectTimelineCue
 One effect-local timeline cue evaluated against the effect clock. 更多...
 
class  ParticleEmitter
 ECS emitter entity. Script configures components; ParticleSimSystem / ParticleRenderSystem drive per-frame update & draw. 更多...
 
class  ParticleEmitterPool
 Soft pool of idle emitters for short-lived gameplay VFX. 更多...
 
struct  ParticleFrameStats
 Counters from the most recent particle update and render pass. 更多...
 
class  ParticleGradient
 Multi-stop color gradient sampled with linear interpolation between stops. Stops are kept sorted by t. Empty gradient means "use the legacy colorStart/colorEnd two-point lerp". 更多...
 
class  ParticleLightSystem
 Syncs pooled Light2D entities with alive particles (emitters with lights.enabled). 更多...
 
class  ParticleRenderSystem
 Draws all visible ParticleEmitter entities via Graphics batch path. 更多...
 
class  Particles
 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. 更多...
 
class  ParticleSimSystem
 Advances all ParticleEmitter Sim components. 更多...
 
class  PcgMaterialSelector
 Pcg-compatible particle texture palette that reserves candidate zero. 更多...
 

类型定义

using WorldCollisionFn = bool(*)(float x, float y, float radius, float &nx, float &ny)
 World collision query used by emitters with worldCollision enabled.
 

函数

Result< int > shiftWorldSpaceParticles (ParticleEmitter *emitter, float shiftX, float shiftY)
 Shift live world-space particles after a floating-origin rebase.
 
Result< void > applyGroundParticleCulling (ParticleEmitter *emitter, int playerTag, int visitorTag, bool entered, bool exited)
 Apply one Pcg GroundParticlesCulling trigger event to a caller-owned emitter.
 
eve::Result< void > applyConfigDocument (ParticleEmitter *emitter, eve::json::Value root)
 Apply particle JSON config onto an emitter, including material texture resources. Does not change buffer size or clear live particles.
 
bool applyConfigText (ParticleEmitter *emitter, const std::string &json, std::string *error=nullptr)
 Parse JSON text and apply.
 
bool loadConfigFile (ParticleEmitter *emitter, const std::string &path, std::string *error=nullptr)
 Read path via Filesystem, apply, and bind Resource.path + modtime for hot reload. Returns false if file missing / invalid JSON.
 
bool reloadConfigFile (ParticleEmitter *emitter, std::string *error=nullptr)
 Re-read Resource.path if set; updates modtime.
 
void setWorldCollisionResolver (WorldCollisionFn fn)
 Sets the world collision resolver.
 
WorldCollisionFn getWorldCollisionResolver ()
 Returns the world collision resolver.
 
bool spawnParticleAt (ParticleEmitter::Config &cfg, ParticleEmitter::Sim &sim, float x, float y)
 Spawn particle at.
 
bool spawnParticle (ParticleEmitter::Config &cfg, ParticleEmitter::Sim &sim)
 Spawn particle.
 
bool sampleSkinSpawn (ParticleEmitter::SkinSource &skinSrc, ParticleEmitter::Sim &sim, float &outX, float &outY)
 Sample skin spawn.
 
void syncEmitterSources (ParticleEmitter::Config &cfg, ParticleEmitter::Sim &sim, ParticleEmitter::Attach &attach, ParticleEmitter::SkinSource &skinSrc)
 Sync bone attach + refresh skin cache; call before stepEmitterSim when using Attach/SkinSource.
 
void stepEmitterSim (ParticleEmitter::Config &cfg, ParticleEmitter::Sim &sim, float dt)
 Step emitter sim.
 
EVENGINE_API_DOMAINS float advanceEmitterSim (ParticleEmitter::Config &cfg, ParticleEmitter::Sim &sim, float dt)
 Apply playback speed and optional bounded fixed stepping before simulation.
 
EVENGINE_API_DOMAINS eve::Result< void > advanceEmitterSim (ParticleEmitter::Config &cfg, ParticleEmitter::Sim &sim, const eve::SimulationStep &step)
 Advance with scheduler-provided Duration/Tick; no local playback scaling.
 
ParticleBudgetConfig & particleBudgetConfig ()
 Mutable process-wide scalability configuration.
 
const ParticleFrameStats & particleFrameStats ()
 Statistics for the most recently processed particle frame.
 
ParticleFrameStats & mutableParticleFrameStats ()
 Internal mutable statistics used by particle systems.
 
 Module_IMPL (Particles, new Particles())
 
void registerParticlesAttackVfxExecutor ()
 Registers particles attack vfx executor.
 
void unregisterParticlesAttackVfxExecutor ()
 Unregisters particles attack vfx executor.
 
void registerParticlesCapabilities ()
 Registers particles capabilities.
 
eve::Result< void > runParticleSimulation (const eve::SimulationStep &step, bool legacyControls)
 
Result< void > applyUnderwaterParticles (ParticleEmitter *ambience, ParticleEmitter *transition, bool active, bool transitionFx, bool entered, bool exited)
 Apply Pcg underwater ambience and transition visibility to particle emitters.
 
Result< void > applyUnderwaterSurfaceVfx (ParticleEmitter *surfaceVfx, bool active)
 Apply Pcg's inverse underwater state to one surface weather or VFX emitter.
 

类型定义说明

◆ WorldCollisionFn

using eve::particles::WorldCollisionFn = typedef bool (*)(float x, float y, float radius, float &nx, float &ny)

World collision query used by emitters with worldCollision enabled.

在文件 ParticleEmitter.h 第 730 行定义.

函数说明

◆ advanceEmitterSim() [1/2]

◆ advanceEmitterSim() [2/2]

◆ applyConfigDocument()

eve::Result< void > eve::particles::applyConfigDocument ( ParticleEmitter *  emitter,
eve::json::Value  root 
)

Apply particle JSON config onto an emitter, including material texture resources. Does not change buffer size or clear live particles.

返回
Success, or InvalidArgument when the root is missing / not an object.

在文件 ParticleConfig.cpp 第 117 行定义.

引用了 a, area, ax, ay, b, binding, bindings, c, count, depth, emitter, enabled, eve::Diagnostic::error(), f, eve::Result< T >::failure(), g, h, eve::InvalidArgument, key, material, n, path, r, radius, rate, restitution, root, soft, step, strength, eve::Result< T >::success(), t, type, v, width, x , 以及 y.

被这些函数引用 applyConfigText().

◆ applyConfigText()

bool eve::particles::applyConfigText ( ParticleEmitter *  emitter,
const std::string &  json,
std::string *  error 
)

Parse JSON text and apply.

在文件 ParticleConfig.cpp 第 452 行定义.

引用了 applyConfigDocument(), emitter, error, eve::json::Document::parse() , 以及 root.

被这些函数引用 eve::particles::ParticleEmitter::applyConfig() , 以及 loadConfigFile().

◆ applyGroundParticleCulling()

EVENGINE_API_DOMAINS Result< void > eve::particles::applyGroundParticleCulling ( ParticleEmitter *  emitter,
int  playerTag,
int  visitorTag,
bool  entered,
bool  exited 
)

Apply one Pcg GroundParticlesCulling trigger event to a caller-owned emitter.

参数
emitterRequired ground-weather emitter.
playerTagStable nonzero tag configured for the player visitor shape.
visitorTagStable tag copied from the physics trigger event.
enteredTrue for a begin-overlap event.
exitedTrue for an end-overlap event.
返回
Success, or InvalidArgument before mutation for malformed input. @ownership The emitter remains caller-owned and is never retained. @thread Simulation owner thread only; callbacks are not invoked. A matching enter starts the emitter and a matching exit stops it. Unrelated visitors are ignored.

在文件 GroundParticleCulling.cpp 第 7 行定义.

引用了 emitter, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument , 以及 eve::Result< T >::success().

◆ applyUnderwaterParticles()

EVENGINE_API_DOMAINS Result< void > eve::particles::applyUnderwaterParticles ( ParticleEmitter *  ambience,
ParticleEmitter *  transition,
bool  active,
bool  transitionFx,
bool  entered,
bool  exited 
)

Apply Pcg underwater ambience and transition visibility to particle emitters.

参数
ambienceRequired caller-owned looping ambience emitter.
transitionOptional caller-owned one-shot transition emitter.
activeWhether underwater ambience should be visible and running.
transitionFxWhether transition effects are enabled by the profile.
enteredWhether this frame crossed from surface to underwater.
exitedWhether this frame crossed from underwater to surface.
返回
Success or InvalidArgument; validation completes before mutation. @ownership Emitters remain caller-owned and are never retained. @thread Simulation owner thread only; callbacks are not invoked.

在文件 UnderwaterParticles.cpp 第 7 行定义.

引用了 active, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, eve::particles::ParticleEmitter::isStopped(), eve::particles::ParticleEmitter::setVisible(), eve::particles::ParticleEmitter::start(), eve::particles::ParticleEmitter::stop() , 以及 eve::Result< T >::success().

◆ applyUnderwaterSurfaceVfx()

EVENGINE_API_DOMAINS Result< void > eve::particles::applyUnderwaterSurfaceVfx ( ParticleEmitter *  surfaceVfx,
bool  active 
)

Apply Pcg's inverse underwater state to one surface weather or VFX emitter.

参数
surfaceVfxRequired caller-owned emitter representing a surface-only effect.
activeWhether the surface effect should be visible and running.
返回
Success or InvalidArgument; a null emitter is rejected without mutation. @ownership The emitter remains caller-owned and is never retained. @thread Simulation owner thread only; callbacks are not invoked.

在文件 UnderwaterParticles.cpp 第 29 行定义.

引用了 active, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, eve::particles::ParticleEmitter::isStopped(), eve::particles::ParticleEmitter::setVisible(), eve::particles::ParticleEmitter::start(), eve::particles::ParticleEmitter::stop() , 以及 eve::Result< T >::success().

◆ getWorldCollisionResolver()

WorldCollisionFn eve::particles::getWorldCollisionResolver ( )

Returns the world collision resolver.

在文件 ParticleEmitter.cpp 第 338 行定义.

被这些函数引用 stepEmitterSim().

◆ loadConfigFile()

bool eve::particles::loadConfigFile ( ParticleEmitter *  emitter,
const std::string &  path,
std::string *  error 
)

Read path via Filesystem, apply, and bind Resource.path + modtime for hot reload. Returns false if file missing / invalid JSON.

在文件 ParticleConfig.cpp 第 475 行定义.

引用了 applyConfigText(), emitter, error, path , 以及 text.

被这些函数引用 eve::particles::ParticleEmitter::loadConfig(), eve::particles::Particles::newEmitterFromFile() , 以及 reloadConfigFile().

◆ Module_IMPL()

eve::particles::Module_IMPL ( Particles  ,
new   Particles() 
)

◆ mutableParticleFrameStats()

ParticleFrameStats & eve::particles::mutableParticleFrameStats ( )

Internal mutable statistics used by particle systems.

在文件 ParticleRuntime.cpp 第 12 行定义.

被这些函数引用 eve::particles::ParticleRenderSystem::render() , 以及 runParticleSimulation().

◆ particleBudgetConfig()

◆ particleFrameStats()

◆ registerParticlesAttackVfxExecutor()

void eve::particles::registerParticlesAttackVfxExecutor ( )

Registers particles attack vfx executor.

在文件 ParticlesAttackVfx.cpp 第 159 行定义.

被这些函数引用 registerParticlesCapabilities().

◆ registerParticlesCapabilities()

void eve::particles::registerParticlesCapabilities ( )

Registers particles capabilities.

在文件 ParticlesCapabilities.cpp 第 469 行定义.

引用了 impl , 以及 registerParticlesAttackVfxExecutor().

被这些函数引用 eve::particles::Particles::Particles().

◆ reloadConfigFile()

bool eve::particles::reloadConfigFile ( ParticleEmitter *  emitter,
std::string *  error 
)

Re-read Resource.path if set; updates modtime.

在文件 ParticleConfig.cpp 第 508 行定义.

引用了 emitter, error, loadConfigFile() , 以及 path.

被这些函数引用 eve::particles::ParticleConfigSystem::poll() , 以及 eve::particles::ParticleEmitter::reloadConfig().

◆ runParticleSimulation()

◆ sampleSkinSpawn()

◆ setWorldCollisionResolver()

void eve::particles::setWorldCollisionResolver ( WorldCollisionFn  fn)

Sets the world collision resolver.

在文件 ParticleEmitter.cpp 第 336 行定义.

引用了 fn.

◆ shiftWorldSpaceParticles()

EVENGINE_API_DOMAINS Result< int > eve::particles::shiftWorldSpaceParticles ( ParticleEmitter *  emitter,
float  shiftX,
float  shiftY 
)

Shift live world-space particles after a floating-origin rebase.

参数
emitterRequired caller-owned world-space emitter.
shiftXHorizontal origin delta to subtract from particle positions.
shiftYVertical particle-plane origin delta to subtract from positions.
返回
Number of CPU and GPU-resident live particles scheduled for translation. @ownership The emitter remains caller-owned and is never retained. @thread Simulation owner thread only; call before the next particle update/render. Playback, pause state, velocity, lifetime and emitter position remain unchanged.

在文件 FloatingPointFixParticles.cpp 第 9 行定义.

引用了 emitter, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument , 以及 eve::Result< T >::success().

◆ spawnParticle()

◆ spawnParticleAt()

◆ stepEmitterSim()

void eve::particles::stepEmitterSim ( ParticleEmitter::Config &  cfg,
ParticleEmitter::Sim &  sim,
float  dt 
)

Step emitter sim.

在文件 ParticleEmitter.cpp 第 415 行定义.

引用了 eve::particles::ParticleEmitter::Sim::active, eve::particles::ParticleEmitter::Sim::alive, ax, ay, b, bounce, eve::particles::ParticleEmitter::Config::boundsMaxX, eve::particles::ParticleEmitter::Config::boundsMaxY, eve::particles::ParticleEmitter::Config::boundsMinX, eve::particles::ParticleEmitter::Config::boundsMinY, eve::particles::ParticleEmitter::Config::bursts, eve::particles::ParticleEmitter::Config::collisionBoundsEnabled, eve::particles::ParticleEmitter::Config::collisionLifetimeLoss, eve::particles::ParticleEmitter::Config::collisionMode, eve::particles::ParticleEmitter::Config::collisionRadius, eve::particles::ParticleEmitter::Config::collisionRestitution, eve::particles::ParticleEmitter::Config::damping, eve::Defined, distance, eve::particles::ParticleEmitter::Sim::distanceEmitAccum, dx, dy, eve::particles::ParticleEmitter::Config::emissionRate, eve::particles::ParticleEmitter::Config::emissionRateOverDistance, eve::particles::ParticleEmitter::Sim::emitAccum, eve::particles::ParticleEmitter::Sim::emitterAge, eve::particles::ParticleEmitter::Config::emitterLife, eve::particles::ParticleCurve::empty(), f, fn, eve::particles::ParticleEmitter::Config::forceFields, eve::particles::ParticleEmitter::Config::frameRate, getWorldCollisionResolver(), eve::IParticleSdfField::gradient(), eve::particles::ParticleEmitter::Config::gravityX, eve::particles::ParticleEmitter::Config::gravityY, eve::particles::ParticleEmitter::Sim::hasLastPos, hit, eve::particles::ParticleEmitter::Config::inheritVelocity, eve::particles::ParticleEmitter::Sim::lastX, eve::particles::ParticleEmitter::Sim::lastY, eve::particles::ParticleEmitter::Config::limitVelocity, eve::particles::ParticleEmitter::Config::looping, eve::particles::ParticleEmitter::Config::maxDeltaTime, eve::particles::ParticleEmitter::Config::noiseFrequency, eve::particles::ParticleEmitter::Config::noiseSpeed, eve::particles::ParticleEmitter::Config::noiseStrength, nx, ny, eve::particles::ParticleEmitter::Config::overflowMode, eve::particles::ParticleEmitter::Sim::overflowWarned, p, eve::particles::ParticleEmitter::Config::particleH, eve::particles::ParticleEmitter::Sim::particles, eve::particles::ParticleEmitter::Config::particleW, eve::particles::ParticleEmitter::Sim::paused, eve::particles::ParticleEmitter::Config::resolvedParameterScale(), s, eve::particles::ParticleCurve::sample(), eve::IParticleSdfField::sample(), scale, eve::particles::ParticleEmitter::Config::sdfField, eve::particles::ParticleEmitter::Config::simSpace, spawned, spawnParticle(), spawnParticleAt(), t, eve::particles::ParticleEmitter::Config::velocityCurve, eve::particles::Particle::vx, eve::particles::Particle::vy, eve::particles::ParticleEmitter::Config::worldCollision, eve::particles::ParticleEmitter::Config::x , 以及 eve::particles::ParticleEmitter::Config::y.

被这些函数引用 advanceEmitterSim(), advanceEmitterSim() , 以及 eve::particles::ParticleEmitter::start().

◆ syncEmitterSources()

◆ unregisterParticlesAttackVfxExecutor()

void eve::particles::unregisterParticlesAttackVfxExecutor ( )

Unregisters particles attack vfx executor.

在文件 ParticlesAttackVfx.cpp 第 169 行定义.

被这些函数引用 eve::particles::Particles::~Particles().