9#include <unordered_map>
24 std::string
on =
"death";
55 std::vector<ParticleEffectTimelineCue>
cues;
71 static constexpr int kMaxSupportedVersion = 2;
73 static constexpr int kMinSupportedVersion = 1;
86 std::string*
error =
nullptr);
104 int getEmitterCount()
const;
106 std::string getEmitterName(
int index)
const;
113 [[nodiscard]] std::span<const ParticleEffectEventRoute> eventRoutes()
const;
134 [[nodiscard]]
Result<void> reloadFromText(
const std::string& json);
150 void updateTimeline(
float dt);
152 static void tickRegisteredTimelines(
float dt);
157 void setPosition(
float x,
float y);
159 float getX()
const {
return x_; }
161 float getY()
const {
return y_; }
163 void setRotation(
float radians);
167 void setScale(
float scale);
171 void setLayer(
int layer);
188 bool emit(
const std::string& emitterName,
int count);
191 void setFloatParameter(
const std::string&
name,
float value);
193 float getFloatParameter(
const std::string&
name)
const;
195 bool hasFloatParameter(
const std::string&
name)
const;
203 float baseDirection = 0.f;
208 ParticleEffectTimelineCue cue;
212 ParticleEffect() =
default;
213 [[nodiscard]]
static Result<ParticleEffect*> parse(
const std::string& json,
215 void syncTransform();
217 void wireEventRoutes();
218 void rewindTimelineClock();
219 void registerForTimelineTicks();
220 void unregisterFromTimelineTicks();
221 [[nodiscard]] Result<void> fireDueCues(
double previousSeconds,
double currentSeconds);
222 [[nodiscard]] Result<void> applyCue(
const ParticleEffectTimelineCue& cue);
223 void adoptParsed(ParticleEffect&& other,
bool preserveWorldState);
226 std::string sourcePath_;
227 std::vector<Layer> layers_;
228 std::unordered_map<std::string, float> parameters_;
229 std::vector<ParticleEffectEventRoute> eventRoutes_;
230 ParticleEffectTimeline timeline_;
231 std::vector<RuntimeCue> runtimeCues_;
232 double timelineSeconds_ = 0.0;
233 bool timelinePlaying_ =
false;
234 bool timelinePaused_ =
false;
235 bool timelineRegistered_ =
false;
238 float rotation_ = 0.f;
241 bool visible_ =
true;
#define EVENGINE_API_DOMAINS
std::array< float, 3 > scale
Move-only, checked operation results for the common layer.
std::unique_ptr< TrailEmitter > emitter
Common time values and an injectable deterministic simulation clock.
Move-only operation result carrying either a value or Status.
Runtime instance of a versioned, multi-emitter particle effect asset.
std::string getSourcePath() const
Return the source file path, or empty text for an in-memory asset.
float getY() const
Return the group origin Y coordinate.
int getLayer() const
Return the group render-layer offset.
ParticleEffect & operator=(const ParticleEffect &)=delete
int getVersion() const
Return the asset schema version.
float getTimelineSeconds() const
Return the current effect-local timeline clock in seconds.
const ParticleEffectTimeline & timeline() const
Return authored timeline controls.
ParticleEffect(const ParticleEffect &)=delete
bool isTimelinePlaying() const
Return true while the effect timeline is advancing.
float getRotation() const
Return the group rotation in radians.
bool isVisible() const
Return the group visibility state.
float getX() const
Return the group origin X coordinate.
float getScale() const
Return the local-offset scale.
ECS emitter entity. Script configures components; ParticleSimSystem / ParticleRenderSystem drive per-...
One deterministic fixed-step emitted by SimulationClock.
One authored cross-emitter event route inside a particle effect asset.
One effect-local timeline cue evaluated against the effect clock.
Effect-level timeline controls (schema v2, optional on v1).
std::vector< ParticleEffectTimelineCue > cues