载入中...
搜索中...
未找到
ParticleEmitter.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
5#include "common/ECS.h"
7#include "common/Time.h"
10
11#include <algorithm>
12#include <cstdint>
13#include <random>
14#include <string>
15#include <unordered_map>
16#include <vector>
17
18namespace eve {
19class IParticleSdfField;
20}
21
22namespace eve::graphics {
23class Graphics;
24class Camera2D;
25class Canvas;
26class Light2D;
27class Shader;
28class Texture;
29}
30
31namespace eve::animation {
32class AnimPose;
33class AnimSkeleton;
34class AnimSkin;
35class SpineSkeleton;
36}
37
38namespace eve::ik {
39class Skeleton2D;
40class Skeleton3D;
41}
42
43namespace eve::particles {
44
45using eve::Color;
46
48struct Particle {
52 std::uint64_t birthSerial = 0;
53 float x = 0.f;
54 float y = 0.f;
55 float vx = 0.f;
56 float vy = 0.f;
57 float ax = 0.f;
58 float ay = 0.f;
59 float radial = 0.f;
60 float tangential = 0.f;
61 float life = 0.f;
62 float lifetime = 1.f;
63 float size = 1.f;
64 float rot = 0.f;
65 float spin = 0.f;
67 float frame = 0.f;
69 float noisePhase = 0.f;
70};
71
76class EVENGINE_API_DOMAINS ParticleEmitter : public ecs::Entity {
77public:
79 ENTITY(ParticleEmitter, ecs::Entity)
80
81
82 void release() override;
83
85 struct Config {
87 struct Burst {
88 float time = 0.f;
89 int count = 0;
90 bool emitted = false;
91 };
92
93 float x = 0.f;
94 float y = 0.f;
95 float emissionRate = 0.f;
97 float emissionRateOverDistance = 0.f;
98 float lifeMin = 1.f;
99 float lifeMax = 1.f;
100 float emitterLife = -1.f; // -1 = forever
102 bool looping = false;
104 float playbackSpeed = 1.f;
106 float fixedTimeStep = 0.f;
108 int maxSubSteps = 8;
110 int randomSeed = 0;
112 bool autoRandomSeed = true;
115 std::string parameter;
116 float scale = 1.f;
117 float offset = 0.f;
118 };
120 std::unordered_map<std::string, float> floatParameters;
121 std::unordered_map<std::string, ParameterBinding> parameterBindings;
123 float resolvedParameterScale(const std::string& target) const {
124 auto binding = parameterBindings.find(target);
125 if (binding == parameterBindings.end()) return 1.f;
126 auto value = floatParameters.find(binding->second.parameter);
127 if (value == floatParameters.end()) return 1.f;
129 return std::max(0.f, value->second * binding->second.scale + binding->second.offset);
130 }
131 float direction = 0.f;
132 float spread = 0.f;
133 float speedMin = 0.f;
134 float speedMax = 0.f;
135 float accelXMin = 0.f, accelYMin = 0.f;
136 float accelXMax = 0.f, accelYMax = 0.f;
137 float radialMin = 0.f, radialMax = 0.f;
138 float tangentialMin = 0.f, tangentialMax = 0.f;
139 float particleW = 8.f;
140 float particleH = 8.f;
141 float sizeStart = 1.f;
142 float sizeEnd = 1.f;
143 float sizeVariation = 0.f; // 0..1
144 float spinMin = 0.f;
145 float spinMax = 0.f;
147 float gravityX = 0.f;
148 float gravityY = 0.f;
150 float damping = 0.f;
152 float limitVelocity = 0.f;
156 float inheritVelocity = 0.f;
158 std::string simSpace = "world";
160 float noiseStrength = 0.f;
161 float noiseFrequency = 1.f;
162 float noiseSpeed = 1.f;
164 std::string collisionMode = "none";
165 float collisionRadius = 0.f; // 0 = particle size/2
166 float collisionRestitution = 0.6f;
167 float collisionLifetimeLoss = 0.f; // fraction of life removed per hit
168 bool collisionBoundsEnabled = false;
169 float boundsMinX = 0.f;
170 float boundsMinY = 0.f;
171 float boundsMaxX = 0.f;
172 float boundsMaxY = 0.f;
174 bool worldCollision = false;
179 eve::IParticleSdfField* sdfField = nullptr;
185 std::string motionVectorPolicy = "none";
187 std::string renderMode = "billboard";
188 float stretchFactor = 1.f;
190 float renderAxisDegrees = 0.f;
192 std::string sortMode = "none";
194 std::string materialMode = "unlit";
196 float distortionStrength = 8.f;
198 float ribbonWidth = 1.f;
199 float ribbonMinSegmentLength = 1.f;
201 bool softParticles = false;
202 float softParticleDepth = 0.5f;
203 float softFadeDistance = 0.05f;
205 std::string overflowMode = "drop";
207 float maxDeltaTime = 0.f;
209 float prewarmSeconds = 0.f;
211 bool gpuSimulation = false;
213 int priority = 0;
215 int minimumQuality = 0;
217 std::string cullingMode = "automatic";
219 float cullDistance = 0.f;
221 int maxSpawnPerFrame = 0;
222 std::vector<Burst> bursts;
224 struct ForceField {
225 float x = 0.f;
226 float y = 0.f;
227 float radius = 0.f;
228 float strength = 0.f;
229 float falloff = 1.f; // exponent; 1 = linear
230 };
231 std::vector<ForceField> forceFields;
233 struct LightCfg {
234 bool enabled = false;
235 int max = 4; // capped at 8 per emitter (engine limit per canvas)
236 float radius = 120.f;
237 float intensity = 1.f;
238 float r = 1.f;
239 float g = 1.f;
240 float b = 1.f;
243 struct SubEmitter {
245 std::string trigger = "birth"; // "birth" | "death" | "collision"
246 float inheritVelocity = 0.f;
247 };
248 std::vector<SubEmitter> subEmitters;
250 float startRotMin = 0.f;
251 float startRotMax = 0.f;
253 int hframes = 1;
254 int vframes = 1;
255 float frameRate = 0.f;
257 float frameRandomStart = 0.f;
265 std::string areaType = "none";
266 float areaX = 0.f;
267 float areaY = 0.f;
268 Color colorStart{1.f, 1.f, 1.f, 1.f};
269 Color colorEnd{1.f, 1.f, 1.f, 0.f};
271 };
272
273 struct Sim {
277 double recordingSeconds = 0;
278
284 std::uint64_t nextBirthSerial = 1;
285 std::vector<Particle> particles;
286 int alive = 0;
287 float emitAccum = 0.f;
288 float distanceEmitAccum = 0.f;
289 float fixedTimeAccum = 0.f;
290 float emitterAge = 0.f;
291 bool active = false;
292 bool paused = false;
293 bool hasLastPos = false;
294 float lastX = 0.f;
295 float lastY = 0.f;
296 bool overflowWarned = false;
297 int activeSeed = 0;
300 bool hasSimulationTick = false;
302 int spawnQuota = -1;
303 int spawnedThisFrame = 0;
304 int droppedSpawnsThisFrame = 0;
305 std::mt19937 rng;
306 };
307
308 struct Draw {
311 graphics::Texture* normalTexture = nullptr;
312 graphics::Canvas *canvas = nullptr; // nullptr → screen
313 graphics::Camera2D *camera = nullptr; // nullptr → screen space (no camera)
314 BlendMode blend = BlendMode::Alpha;
315 graphics::Shader *shader = nullptr; // custom fragment pipeline (textured quads only)
316 int layer = 0;
317 bool visible = true;
318 };
319
321 struct Resource {
323 enum class ReloadObservation {
324 Unbound,
325 AutoReloadDisabled,
326 MtimePollingUnchanged,
327 MtimePollingReloaded,
328 MtimeUnavailable,
329 MtimePollingReloadFailed,
330 };
331 std::string path;
332 std::string texturePath;
333 std::string normalTexturePath;
334 int64_t modtime = -1;
335 bool autoReload = true;
337 ReloadObservation lastReloadObservation = ReloadObservation::Unbound;
338 };
339
350 struct Attach {
352 enum class Kind { None, AnimPose, Spine, Ik2D, Ik3D };
353
354 Kind kind = Kind::None;
356 animation::AnimSkeleton *skeleton = nullptr; // optional (name lookup)
357 animation::SpineSkeleton *spine = nullptr;
358 eve::ik::Skeleton2D *ik2d = nullptr;
359 eve::ik::Skeleton3D *ik3d = nullptr;
360 int boneIndex = -1;
361 float offsetX = 0.f;
362 float offsetY = 0.f;
363 float offsetZ = 0.f;
365 std::string plane = "xy";
366 float scale = 1.f;
367 bool followRotation = false;
368 bool enabled = false;
369 };
370
375 struct SkinSource {
376 animation::AnimSkin *skin = nullptr;
378 animation::AnimSkeleton *skeleton = nullptr; // optional (name filter)
379 int filterBone = -1; // skeleton bone index, -1 = all
380 float minWeight = 0.f;
382 std::string plane = "xy";
383 float scale = 1.f;
384 bool enabled = false;
386 std::vector<int> candidates;
387 bool candidatesDirty = true;
388 int lastSkinnedFrame = -1;
389 };
390
392 struct Lights {
393 std::vector<graphics::Light2D *> pool;
394 };
395
397 struct GpuSim {
398 bool enabled = false;
399 bool failed = false;
401 std::uint64_t residentHandle = 0;
403 bool residentActive = false;
405 int estimatedAlive = 0;
407 double timeline = 0.0;
409 std::vector<float> deathTimes;
411 float pendingWorldOffsetX = 0.f;
412 float pendingWorldOffsetY = 0.f;
414 std::uint32_t nextBirthSerial = 1;
415 };
416
417 COMPONENT(Config, config)
418 COMPONENT(Sim, sim)
419 COMPONENT(Draw, draw)
420 COMPONENT(Resource, resource)
421 COMPONENT(Attach, attach)
422 COMPONENT(SkinSource, skinSource)
423 COMPONENT(Lights, lights)
424 COMPONENT(GpuSim, gpuSim)
425
426 static ParticleEmitter *createEmitter(int bufferSize = 1000);
427
428 void setPosition(float x, float y);
429 void moveTo(float x, float y);
430 float getX();
431 float getY();
432
433 void setEmissionRate(float rate);
434 float getEmissionRate();
436 void setEmissionRateOverDistance(float rate);
438 float getEmissionRateOverDistance();
439
440 void setParticleLifetime(float minLife, float maxLife);
441 float getParticleLifetimeMin();
442 float getParticleLifetimeMax();
443
444 void setEmitterLifetime(float seconds);
445 float getEmitterLifetime();
447 void setLooping(bool looping);
449 bool getLooping();
451 void setPlaybackSpeed(float speed);
453 float getPlaybackSpeed();
455 void setFixedTimeStep(float seconds, int maxSubSteps = 8);
457 float getFixedTimeStep();
459 void setRandomSeed(int seed);
461 int getRandomSeed();
463 void setAutoRandomSeed(bool enabled);
465 bool getAutoRandomSeed();
466
467 void setDirection(float radians);
468 float getDirection();
469
470 void setSpread(float radians);
471 float getSpread();
472
473 void setSpeed(float minSpeed, float maxSpeed);
474 void setLinearAcceleration(float xmin, float ymin, float xmax, float ymax);
475 void setRadialAcceleration(float minA, float maxA);
476 void setTangentialAcceleration(float minA, float maxA);
477
478 void setEmissionArea(const std::string &type, float x, float y);
479 std::string getEmissionAreaType();
480 float getEmissionAreaX();
481 float getEmissionAreaY();
482
483 void setParticleSize(float width, float height);
484 float getParticleWidth();
485 float getParticleHeight();
486
487 void setSizes(float startScale, float endScale);
488 void setSizeVariation(float variation);
489 float getSizeVariation();
490
491 void setSpin(float minSpin, float maxSpin);
492 void setStartRotation(float minDeg, float maxDeg);
493
494 void addBurst(float time, int count);
495 void clearBursts();
496 void setPrewarm(float seconds);
497 float getPrewarmSeconds();
498
499 void setGravity(float x, float y);
500 void setDamping(float perSecond);
501 void setLimitVelocity(float maxSpeed);
502 void clearVelocityCurve();
503 void addVelocityCurvePoint(float t, float v);
504 void setInheritVelocity(float fraction);
505 void setSimulationSpace(const std::string &space);
506 void setNoise(float strength, float frequency = 1.f, float speed = 1.f);
507 void setGpuSimulation(bool enable);
508 bool getGpuSimulation();
510 bool isGpuSimulationActive();
512 bool isGpuFeatureSetSupported();
514 std::string getSimulationBackend();
516 std::string getGpuFallbackReason();
517
519 void setFloatParameter(const std::string& name, float value);
521 float getFloatParameter(const std::string& name, float fallback = 0.f);
523 bool hasFloatParameter(const std::string& name);
525 void clearFloatParameters();
527 void bindFloatParameter(const std::string& name, const std::string& target, float scale = 1.f, float offset = 0.f);
529 void clearFloatParameterBindings();
531 float getResolvedParameterScale(const std::string& target);
532
534 void setPriority(int priority);
536 int getPriority();
538 void setMinimumQuality(int quality);
540 int getMinimumQuality();
542 void setCullingMode(const std::string &mode);
544 std::string getCullingMode();
546 void setCullDistance(float distance);
548 float getCullDistance();
550 void setMaxSpawnPerFrame(int count);
552 int getMaxSpawnPerFrame();
553
554 void setCollision(const std::string &mode, float radius = 0.f, float restitution = 0.6f,
555 float lifetimeLoss = 0.f);
556 void setCollisionBounds(bool enabled, float minX, float minY, float maxX, float maxY);
557 void setWorldCollision(bool enabled);
562 void setSdfField(eve::IParticleSdfField* field);
569 eve::IParticleSdfField* getSdfField();
575 void setMotionVectorPolicy(const std::string& policy);
577 std::string getMotionVectorPolicy();
579 bool isMotionVectorActive();
580
581 void setRenderMode(const std::string &mode, float stretchFactor = 1.f);
583 void setRibbon(float width = 1.f, float minSegmentLength = 1.f);
585 void setSoftParticles(bool enabled, float particleDepth = 0.5f, float fadeDistance = 0.05f);
587 bool isSoftParticlesActive();
589 void setRenderAxis(float degrees);
591 void setSortMode(const std::string& mode);
593 std::string getSortMode();
595 void setMaterialMode(const std::string& mode);
597 std::string getMaterialMode();
599 void setDistortionStrength(float strengthPixels);
601 float getDistortionStrength();
602 void setOverflowMode(const std::string &mode);
603 void setMaxDeltaTime(float seconds);
604
605 void addSubEmitter(ParticleEmitter *target, const std::string &trigger,
606 float inheritVelocity = 0.f);
607 void clearSubEmitters();
608
609 void addForceField(float x, float y, float radius, float strength, float falloff = 1.f);
610 void clearForceFields();
611
612 void setShader(graphics::Shader *shader);
613 graphics::Shader *getShader();
614
615 void setLights(bool enabled, float radius = 120.f, float intensity = 1.f, float r = 1.f,
616 float g = 1.f, float b = 1.f, int maxLights = 4);
617 bool getLightsEnabled();
618
619 void setBlendMode(const std::string &mode);
620 std::string getBlendMode();
621
622 void setFlipbook(int hframes, int vframes, float framesPerSecond = 0.f,
623 float randomStart = 0.f);
624
625 void clearColorGradient();
626 void addColorStop(float t, float r, float g, float b, float a);
627 void clearSizeCurve();
628 void addSizeCurvePoint(float t, float v);
629 void clearRotationCurve();
630 void addRotationCurvePoint(float t, float v);
631
632 void setColorStart(float r, float g, float b, float a = 1.f);
633 void setColorEnd(float r, float g, float b, float a = 1.f);
634
635 void setTexture(graphics::Texture *texture);
636 graphics::Texture *getTexture();
638 void setNormalTexture(graphics::Texture* texture);
640 graphics::Texture* getNormalTexture();
641
642 void setCanvas(graphics::Canvas *canvas);
643 void setCamera(graphics::Camera2D *camera);
644
645 void setLayer(int layer);
646 int getLayer();
647
648 void setVisible(bool visible);
649 bool isVisible();
650
651 void start();
652 void stop();
653 void pause();
654 void reset();
655 void emit(int count);
656
667 [[nodiscard]] eve::Result<void> advance(const eve::SimulationStep &step);
668
670 [[nodiscard]] eve::SimulationTick currentSimulationTick() const noexcept {
671 // ECS.hpp's generated accessor has no const overload and would create
672 // a missing component. Query the existing table buffer directly so a
673 // read-only tick query neither casts away constness nor mutates ECS.
674 auto *const buffer = storage ? storage->getComponentBuffer<Sim>() : nullptr;
675 if (!buffer || id >= buffer->size()) return eve::SimulationTick::zero();
676 // The size guard makes this existing-slot read non-mutating; ECS.hpp's
677 // const overload currently attempts to resize its deque.
678 return buffer->get(id).simulationTick;
679 }
680
681 bool isActive();
682 bool isPaused();
683 bool isStopped();
684
685 int getCount();
686 int getBufferSize();
687
689 void applyPreset(const std::string &name);
690
691 bool applyConfig(const std::string &json);
692 bool loadConfig(const std::string &path);
693 bool reloadConfig();
694 void setAutoReload(bool enable);
695 bool getAutoReload();
696 std::string getConfigPath();
698 [[nodiscard]] std::string getConfigReloadObservation() const;
699
700 // --- Bone attachment (3D AnimPose / 2D Spine / IK 2D·3D) ---
701 void attachToBone(animation::AnimPose *pose, int boneIndex);
702 void attachToBoneByName(animation::AnimPose *pose, animation::AnimSkeleton *skeleton,
703 const std::string &boneName);
704 void attachToSpineBone(animation::SpineSkeleton *spine, int boneIndex);
705 void attachToSpineBoneByName(animation::SpineSkeleton *spine, const std::string &boneName);
706 void attachToSkeleton2D(eve::ik::Skeleton2D *skeleton, int boneId);
707 void attachToSkeleton3D(eve::ik::Skeleton3D *skeleton, int boneId);
708 void setAttachOffset(float x, float y, float z);
709 void setAttachPlane(const std::string &plane);
710 void setAttachScale(float scale);
711 void setFollowBoneRotation(bool enable);
712 void detach();
713 bool isAttached();
714 int getAttachBone();
716 std::string getAttachKind();
718 void syncAttach();
719
720 // --- Skinned mesh surface emission ---
721 void setSkinSource(animation::AnimSkin *skin, animation::AnimPose *pose);
722 void setSkinBoneFilter(int skeletonBoneIndex, float minWeight = 0.f);
723 void setSkinBoneFilterByName(animation::AnimSkeleton *skeleton, const std::string &boneName,
724 float minWeight = 0.f);
725 void setSkinPlane(const std::string &plane);
726 void setSkinScale(float scale);
727 void clearSkinSource();
728 bool hasSkinSource();
730 void emitFromSkin(int count);
731};
732
734bool spawnParticle(ParticleEmitter::Config &cfg, ParticleEmitter::Sim &sim);
736bool spawnParticleAt(ParticleEmitter::Config &cfg, ParticleEmitter::Sim &sim, float x, float y);
738void stepEmitterSim(ParticleEmitter::Config &cfg, ParticleEmitter::Sim &sim, float dt);
740EVENGINE_API_DOMAINS float advanceEmitterSim(ParticleEmitter::Config &cfg, ParticleEmitter::Sim &sim, float dt);
742[[nodiscard]] EVENGINE_API_DOMAINS eve::Result<void> advanceEmitterSim(ParticleEmitter::Config &cfg,
743 ParticleEmitter::Sim &sim,
746using WorldCollisionFn = bool (*)(float x, float y, float radius, float &nx, float &ny);
756 float &outY);
757
758} // namespace eve::particles
double z
double y
double x
LogicalId target
Duration start
bool & active
eve::EntitySpatialPose pose
int priority
float degrees
Definition CardTypes.cpp:38
std::string name
Definition ECS.cpp:154
#define EVENGINE_API_DOMAINS
Definition Export.h:110
float strength
tensor::Graph g
Definition GpuGraph.cpp:7
std::vector< eve::ProcgenProbeDesc > lights
float camera[2]
std::uint32_t alive
float colorStart[4]
std::uint32_t sortMode
float colorEnd[4]
double r
float v
float blend
std::uint32_t height
std::uint32_t width
size_t offset
std::array< float, 3 > scale
MeleePoint3 b
Definition MeleeHit.cpp:41
double radius
Definition MeleeHit.cpp:42
MeleePoint3 a
Definition MeleeHit.cpp:40
float distance
MeshVfxBatchedDraw draw
double dt
std::unique_ptr< gpgpu::GpuBuffer > buffer
Definition OnnxGpgpu.cpp:26
eve::action::ActionVfxBinding binding
Texture * texture
TileLayer * layer
std::string path
Definition PlayHost.cpp:111
Object::Ptr value
float t
const EntityFact * entity
Shader * shader
RoadLaneDirection direction
std::string kind
std::string resource
double restitution
int count
float offsetX
float offsetY
bool visible
Common time values and an injectable deterministic simulation clock.
uint32_t seed
Definition TreeMesh.cpp:276
float step
Definition TreeMesh.cpp:451
float fraction
Borrowed 2D signed-distance field consumed by particle collision.
Definition ParticleSdf.h:25
Move-only operation result carrying either a value or Status.
Definition Result.h:176
Evaluated local (and optional world) pose for an AnimSkeleton. Script type: AnimPose.
Definition AnimPose.h:17
3D bone hierarchy + bind-pose local TRS for skeletal animation. Independent of ik::Skeleton3D (FABRIK...
CPU linear-blend skinning binding for one mesh against an AnimSkeleton.
Definition AnimSkin.h:47
Runtime Spine skeleton pose (local + world bone transforms, slot attachments). Script type: SpineSkel...
static constexpr StrongUint64 zero() noexcept
Returns the zero value for this strong type.
Declarative 2D camera (viewport center + zoom).
Canvas public API.
Definition Canvas.h:17
Custom GPU program.
Definition Shader.h:41
GPU texture created via Graphics::newTexture. Owns GPU resources through an opaque backend handle.
Definition Texture.h:15
Script-facing 2D skeleton + pose state. Bone indices are stable after each createBone / topological r...
Definition Skeleton2D.h:16
Script-facing 3D skeleton + pose state. Local angles are yaw/pitch in the parent bone frame.
Definition Skeleton3D.h:15
Multi-point scalar curve sampled with linear interpolation between points. Empty curve means "use the...
ECS emitter entity. Script configures components; ParticleSimSystem / ParticleRenderSystem drive per-...
eve::SimulationTick currentSimulationTick() const noexcept
Last scheduler tick consumed by the checked emitter API.
Bounded owner-thread particle recording buffer with explicit time and sticky errors....
Multi-stop color gradient sampled with linear interpolation between stops. Stops are kept sorted by t...
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition Animation.h:25
EVENGINE_API_DOMAINS float advanceEmitterSim(ParticleEmitter::Config &cfg, ParticleEmitter::Sim &sim, float dt)
Apply playback speed and optional bounded fixed stepping before simulation.
bool spawnParticle(ParticleEmitter::Config &cfg, ParticleEmitter::Sim &sim)
Spawn particle.
void setWorldCollisionResolver(WorldCollisionFn fn)
Sets the world collision resolver.
bool(*)(float x, float y, float radius, float &nx, float &ny) WorldCollisionFn
World collision query used by emitters with worldCollision enabled.
void stepEmitterSim(ParticleEmitter::Config &cfg, ParticleEmitter::Sim &sim, float dt)
Step emitter sim.
WorldCollisionFn getWorldCollisionResolver()
Returns the world collision resolver.
bool sampleSkinSpawn(ParticleEmitter::SkinSource &skinSrc, ParticleEmitter::Sim &sim, float &outX, float &outY)
Sample skin spawn.
void syncEmitterSources(ParticleEmitter::Config &cfg, ParticleEmitter::Sim &, ParticleEmitter::Attach &attach, ParticleEmitter::SkinSource &skinSrc)
Sync bone attach + refresh skin cache; call before stepEmitterSim when using Attach/SkinSource.
bool spawnParticleAt(ParticleEmitter::Config &cfg, ParticleEmitter::Sim &sim, float x, float y)
Spawn particle at.
Build metadata (engine git commit, build time, third-party version).
Definition Build.cpp:16
BlendMode
Render-neutral 2D blend mode shared by graphics-facing modules.
Definition RenderTypes.h:11
glm::vec4 Color
Render-neutral RGBA color shared by graphics-facing modules.
Definition RenderTypes.h:8
SettlementPipeline::Stage fn
bool enabled
One deterministic fixed-step emitted by SimulationClock.
Definition Time.h:158
Optional bone attachment. When enabled, syncAttach() writes Config.x/y (and optionally direction) fro...
Timed burst emission (fired once while the emitter is active).
Radial attract/repel force fields (strength > 0 attract, < 0 repel).
Emitter-level 2D light emission (pooled Light2D entities).
Script-linked sub-emitters (birth / death / collision triggers).
std::unordered_map< std::string, float > floatParameters
Gameplay-owned exposed values and target bindings.
std::unordered_map< std::string, ParameterBinding > parameterBindings
float resolvedParameterScale(const std::string &target) const
Resolved parameter scale.
ParticleCurve rotationCurve
Optional extra rotation (degrees) over lifetime; added on top of spin.
ParticleCurve sizeCurve
Optional size scale curve over lifetime; overrides sizeStart/sizeEnd.
ParticleCurve velocityCurve
Optional speed multiplier curve over lifetime.
ParticleGradient colorGradient
Optional multi-stop gradient; overrides colorStart/colorEnd when non-empty.
Backend-owned GPU-resident simulation state and delayed CPU counters.
std::vector< float > deathTimes
Absolute death times; min-heap with std::greater<float>.
Pooled Light2D entities driven by ParticleLightSystem (lights.enabled).
std::vector< graphics::Light2D * > pool
Bound config file for hot reload (empty path = unbound).
ReloadObservation
ReloadObservation public API.
ParticleEventJournal recording
Optional bounded recording owner; disabled by default, independent of emitter looping/reset age.
Optional skinned-mesh surface source. When enabled, newly spawned particles sample random (optionally...
std::vector< int > candidates
Vertex indices eligible for sampling (rebuilt when filter changes).
Single live particle (CPU simulation).
float noisePhase
Random noise phase per particle (turbulence offset).
std::uint64_t birthSerial
Nonzero CPU birth identity within its owning Sim lifetime; moves with the particle during compaction.
float frame
Flipbook frame progress (float frame index; grid resolved at render).