|
Brunot
|
Creates Particles, based on initial conditions set in the editor, with potential randomness. More...
#include <ParticleSpawner.h>
Public Member Functions | |
| ParticleSpawner ()=default | |
| virtual | ~ParticleSpawner ()=default |
| virtual auto | activate (const AffineMatrix &parentTransform, const Vector4D &scale, float rot) -> std::vector< Particle > |
| spawns particles, based on values set in the editor | |
| virtual auto | particleSpawnMenu () -> void |
| draw the menu for the particle editor that pertains to how particles spawn | |
| auto | particleUpdateMenu () -> void |
| draws the menu for the particle editor that pertains to the | |
Protected Attributes | |
| Particle | maxParticle |
| holds the initial state for a particle when it is spawned. | |
| Particle | minParticle |
| for particle values that are randomized, this holds the minimum value they could be | |
| unsigned | spawnCount = 1u |
| how many particles to spawn at a time | |
| bool | positionRandomize = false |
| bool | velocityRandomize = false |
| bool | scaleRandomize = false |
| bool | rotationRandomize = false |
| bool | rotationalVelocityRandomize = false |
| bool | rotationalAccelerationRandomize = false |
| bool | colorRandomize = false |
| bool | startFrameRandomize = false |
| bool | lifetimeRandomize = false |
Private Types | |
| enum | type { sphere = 1 , cone = 2 , orbit = 3 , singleLoopingParticle = 4 } |
| a type enum that is a remnant of the original plan for subclasses. More... | |
Private Member Functions | |
| template<typename T> | |
| 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 if max isn't greater) | |
| template<typename T> | |
| auto | randBetween (const T &lhs, const T &rhs) -> T |
| returns a random number between 2 numbers | |
| template<> | |
| auto | randBetween (const Vector4D &lhs, const Vector4D &rhs) -> Vector4D |
| explicit specialization of randBetween to work on Vector4Ds. | |
Private Attributes | |
| std::ranlux24_base | randSeed {std::random_device()()} |
Friends | |
| auto | to_json (json &j, const ParticleSpawner &n) ->void |
| auto | from_json (const json &j, ParticleSpawner &n) ->void |
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.
|
private |
a type enum that is a remnant of the original plan for subclasses.
It is unused, but Aidan feels it's a good indicator of what subclasses could be for ParticleSpawner, and so Aidan thinks it should be kept for now
| Enumerator | |
|---|---|
| sphere | |
| cone | |
| orbit | |
| singleLoopingParticle | |
|
default |
|
virtualdefault |
|
virtual |
spawns particles, based on values set in the editor
| parentTransform | Modeling transform for parent |
| scale | scale of the parent |
| rot | rotation of the parent |
|
virtual |
draw the menu for the particle editor that pertains to how particles spawn
| auto ParticleSpawner::particleUpdateMenu | ( | ) | ->void |
draws the menu for the particle editor that pertains to the
|
inlineprivate |
returns a random number between 2 numbers
| T | type of number |
| lhs | one bound |
| rhs | the other bound |
|
inlineprivate |
explicit specialization of randBetween to work on Vector4Ds.
does randomization independently for every value
| lhs | one bound |
| rhs | the other bound |
|
inlineprivate |
randomizes between 2 values, if a boolean is true if the boolean isn't true, simply return max (even if max isn't greater)
| T | Type of value to randomize |
| isRandom | whether to randomize the values |
| min | the first value |
| max | the second value |
|
friend |
|
friend |
|
protected |
|
protected |
|
protected |
holds the initial state for a particle when it is spawned.
for values that are randomized, this holds the maximum value a particle could possibly spawn with
|
protected |
for particle values that are randomized, this holds the minimum value they could be
|
protected |
|
private |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
how many particles to spawn at a time
|
protected |
|
protected |