Brunot
Loading...
Searching...
No Matches
ParticleSpawner.cpp File Reference

Creates Particles, based on initial conditions set in the editor, with potential randomness. More...

#include "ParticleSpawner.h"
#include "Framework/Engine.h"
#include "Graphics/Particle.h"
#include "System/Editor.h"
#include "Texture.h"
#include "Utility/Math/AffineMatrix.h"
Include dependency graph for ParticleSpawner.cpp:

Macros

#define PS_Slider2D(name, value, randomFlag, minVal, maxVal)
 Macro for adjusting simple pairs of values that get a slider.
#define PS_CURVE_2D(name, value, randomFlag, minVal, maxVal)
 Macro for adjusting variables with a bezier curve.
#define PS_Slider(name, value, randomFlag, minVal, maxVal)
 Macro for adjusting single values with a slider.

Functions

auto to_json (json &j, const ParticleSpawner &n) ->void
auto from_json (const json &j, ParticleSpawner &n) ->void

Detailed Description

Creates Particles, based on initial conditions set in the editor, with potential randomness.

This class was originally intended to be able to be overridden, but Aidan quickly realized that was more along the lines of a QOL feature, and so subclasses were relegated to something between postponed and unplanned.

Author
Aidan Hartman (aidan.nosp@m..har.nosp@m.tman@.nosp@m.digi.nosp@m.pen.e.nosp@m.du)
Date
2026 / 03 / 27

Macro Definition Documentation

◆ PS_CURVE_2D

#define PS_CURVE_2D ( name,
value,
randomFlag,
minVal,
maxVal )
Value:
{ \
ImGui::Text(name); \
ImGui::SliderFloat2("Max ##begin" name, maxParticle.##value##Begin.data(), minVal, maxVal); \
maxParticle.##value = maxParticle.##value##Begin; \
if (value##Randomize) \
{ \
ImGui::SliderFloat2("Min ##begin" name, minParticle.##value##Begin.data(), minVal, maxVal); \
minParticle.##value = minParticle.##value##Begin; \
} \
ImGui::Checkbox("randomize##" name, &##value##Randomize); \
\
ImGui::Checkbox("Changes ##" #value, &maxParticle.##value##Changes); \
if (maxParticle.##value##Changes) \
{ \
ImGui::Text("Ending" #value); \
ImGui::SliderFloat2("Max ##end" name, maxParticle.##value##End.data(), minVal, maxVal); \
if (value##Randomize) \
{ \
ImGui::SliderFloat2("Min ##end" name, minParticle.##value##End.data(), minVal, maxVal); \
} \
ImGui::Bezier(name " Curve", maxParticle.##value##Curve.data()); \
} \
}

Macro for adjusting variables with a bezier curve.

◆ PS_Slider

#define PS_Slider ( name,
value,
randomFlag,
minVal,
maxVal )
Value:
{ \
ImGui::Text(name); \
ImGui::SliderFloat("Max ## " name, &maxParticle.##value, minVal, maxVal); \
if (randomFlag) \
{ \
ImGui::SliderFloat("Min ## " name, &minParticle.##value, minVal, maxVal); \
} \
ImGui::Checkbox("randomize##" name, &##randomFlag); \
}

Macro for adjusting single values with a slider.

◆ PS_Slider2D

#define PS_Slider2D ( name,
value,
randomFlag,
minVal,
maxVal )
Value:
{ \
ImGui::Text(name); \
ImGui::SliderFloat2("Max ## " name, maxParticle.##value.data(), minVal, maxVal); \
if (randomFlag) \
{ \
ImGui::SliderFloat2("Min ## " name, minParticle.##value.data(), minVal, maxVal); \
} \
ImGui::Checkbox("randomize##" name, &##randomFlag); \
}

Macro for adjusting simple pairs of values that get a slider.

Function Documentation

◆ from_json()

auto from_json ( const json & j,
ParticleSpawner & n )->void

◆ to_json()

auto to_json ( json & j,
const ParticleSpawner & n )->void