An object that manages many of a single type of particle.
More...
#include <ParticleEmitter.h>
|
| auto | getTimeBetweenSpawns () const -> float |
| | helper function for calculating time between spawns, based on how many spawnsPerSecond
|
An object that manages many of a single type of particle.
It creates them by using a ParticleSpawner, and then sends them to a ParticleBlock, where they are stored and updated
◆ ParticleEmitter() [1/3]
| ParticleEmitter::ParticleEmitter |
( |
| ) |
|
◆ ~ParticleEmitter()
| ParticleEmitter::~ParticleEmitter |
( |
| ) |
|
◆ ParticleEmitter() [2/3]
◆ ParticleEmitter() [3/3]
◆ getName()
| auto ParticleEmitter::getName |
( |
| ) |
const->std::string |
|
nodiscard |
◆ getTimeBetweenSpawns()
| auto ParticleEmitter::getTimeBetweenSpawns |
( |
| ) |
const->float |
|
private |
helper function for calculating time between spawns, based on how many spawnsPerSecond
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ registerWithParticles()
| auto ParticleEmitter::registerWithParticles |
( |
| ) |
const->void |
◆ reset()
| auto ParticleEmitter::reset |
( |
| ) |
->void |
resets the timer on the emitter, so that particles will be emitted next time it updates
◆ setParentTransform()
| auto ParticleEmitter::setParentTransform |
( |
const AffineMatrix & | affineMatrix, |
|
|
Vector4D | scale, |
|
|
float | rot )->void |
set the transforms for the parent Entity, so that Particles will be generated at the right scale and position
- Parameters
-
| affineMatrix | Modeling transform for parent |
| scale | scale of the parent |
| rot | rotation of the parent |
◆ showMenu()
| auto ParticleEmitter::showMenu |
( |
| ) |
->void |
Draw the ImGui menu for the Emitter, has controls for what types of particles are emitted, how they behave, etc.
◆ update()
| auto ParticleEmitter::update |
( |
float | dt | ) |
->void |
runs update for the emitter, the emitter will automatically count down to decide when to emit particles next
- Parameters
-
| dt | time in seconds elapsed since last frame |
setup timer
◆ from_json
◆ to_json
◆ block
where the particles generated by the emitter are stored. this block is also referenced by sys::ParticleManager
◆ name
| std::string ParticleEmitter::name = "Emitter" |
|
private |
The name of the emitter, for ease of reference in editor.
◆ parentRot
| float ParticleEmitter::parentRot = 0 |
|
private |
parent rotation, as last set by setParentTransform
◆ parentScale
parent scale, as last set by setParentTransform
◆ parentTransform
parent transform, as last set by setParentTransform
◆ spawner
◆ spawnsPerSecond
| float ParticleEmitter::spawnsPerSecond = 1.f |
|
private |
how often particles should spawn
◆ timeToNextSpawn
| float ParticleEmitter::timeToNextSpawn = 0.f |
|
private |
how long until particles will spawn next
The documentation for this class was generated from the following files: