67 float rot) -> std::vector<Particle>;
108 std::ranlux24_base
randSeed{std::random_device()()};
119 template <
typename T>
120 auto randIf(
bool& isRandom,
const T& min,
const T& max) -> T
136 template <
typename T>
140 if constexpr (std::is_integral_v<T>)
144 std::uniform_int_distribution<> range(T(0), max(lhs, rhs) - min(lhs, rhs));
145 return range(
randSeed) + min(lhs, rhs);
151 std::uniform_real_distribution<float> range{T(0), max(lhs, rhs) - min(lhs, rhs)};
152 return range(
randSeed) + min(lhs, rhs);
168 std::uniform_real_distribution<float> rangeX(0.f, max(lhs.x(), rhs.x()) - min(lhs.x(), rhs.x()));
169 std::uniform_real_distribution<float> rangeY(0.f, max(lhs.y(), rhs.y()) - min(lhs.y(), rhs.y()));
170 std::uniform_real_distribution<float> rangeZ(0.f, max(lhs.z(), rhs.z()) - min(lhs.z(), rhs.z()));
171 std::uniform_real_distribution<float> rangeW(0.f, max(lhs.w(), rhs.w()) - min(lhs.w(), rhs.w()));
static FMOD_RESULT result
Definition AudioObject.cpp:27
nlohmann::json json
Definition Json.cpp:19
public object interface for a particle, to be passed to Particle system and for saving and loading
type
a type enum that is a remnant of the original plan for subclasses.
Definition ParticleSpawner.h:48
@ orbit
Definition ParticleSpawner.h:51
@ cone
Definition ParticleSpawner.h:50
@ singleLoopingParticle
Definition ParticleSpawner.h:52
@ sphere
Definition ParticleSpawner.h:49
bool lifetimeRandomize
Definition ParticleSpawner.h:104
Particle maxParticle
holds the initial state for a particle when it is spawned.
Definition ParticleSpawner.h:84
auto randBetween(const T &lhs, const T &rhs) -> T
returns a random number between 2 numbers
Definition ParticleSpawner.h:137
auto particleUpdateMenu() -> void
draws the menu for the particle editor that pertains to the
Definition ParticleSpawner.cpp:154
ParticleSpawner()=default
friend auto to_json(json &j, const ParticleSpawner &n) -> void
Definition ParticleSpawner.cpp:238
auto randIf(bool &isRandom, const T &min, const T &max) -> T
randomizes between 2 values, if a boolean is true if the boolean isn't true, simply return max (even ...
Definition ParticleSpawner.h:120
bool startFrameRandomize
Definition ParticleSpawner.h:103
bool scaleRandomize
Definition ParticleSpawner.h:98
bool rotationalVelocityRandomize
Definition ParticleSpawner.h:100
bool rotationRandomize
Definition ParticleSpawner.h:99
friend auto from_json(const json &j, ParticleSpawner &n) -> void
Definition ParticleSpawner.cpp:254
bool positionRandomize
Definition ParticleSpawner.h:96
unsigned spawnCount
how many particles to spawn at a time
Definition ParticleSpawner.h:91
virtual auto activate(const AffineMatrix &parentTransform, const Vector4D &scale, float rot) -> std::vector< Particle >
spawns particles, based on values set in the editor
Definition ParticleSpawner.cpp:34
bool colorRandomize
Definition ParticleSpawner.h:102
virtual auto particleSpawnMenu() -> void
draw the menu for the particle editor that pertains to how particles spawn
Definition ParticleSpawner.cpp:95
bool rotationalAccelerationRandomize
Definition ParticleSpawner.h:101
std::ranlux24_base randSeed
Definition ParticleSpawner.h:108
bool velocityRandomize
Definition ParticleSpawner.h:97
Particle minParticle
for particle values that are randomized, this holds the minimum value they could be
Definition ParticleSpawner.h:88
virtual ~ParticleSpawner()=default
Definition AffineMatrix.h:30
Struct for passing around all the data a particle has, before a particle is added to a Particle Block...
Definition Particle.h:50