Class responsible for creating particle emitters and managing the creation of particles.
More...
#include <particleEmitter.h>
Class responsible for creating particle emitters and managing the creation of particles.
- Author
- Thomas Montano
- Date
- March 2 2020
◆ ParticleEmitter()
Overloaded draw function to render particles to the screen.
Default constructor for a particle emitter that establishes position, color, and velocity constraints.
- Parameters
-
startPos | The location in world coordinates of where the particle emitter should spawn particles. |
initVel | The initial velocity that particles should be subjected to. |
color | The base color of the particles. |
dissolutionRate | The time in seconds that a particle should exist before it gets deleted. |
gravity | The gravity vector each particle will be subjected to. |
◆ fuel()
void rune::ParticleEmitter::fuel |
( |
int |
particles | ) |
|
Spawn particles from the particles emitter.
- Parameters
-
particles | The number of particles that should be generated. |
◆ setCanvasSize()
void rune::ParticleEmitter::setCanvasSize |
( |
rune::Vec2 |
canvas | ) |
|
- Parameters
-
canvas | A vector describing the area that a particle will be allowed to exist in. |
◆ setDissolutionRate()
void rune::ParticleEmitter::setDissolutionRate |
( |
double |
rate | ) |
|
The amount of time in seconds that a particle will exist before it gets destroyed.
param window Overloaded draw function for rendering the particles to the screen.
- Parameters
-
rate | The amount of time in seconds that a particle should exist before being deleted. |
◆ setGravity()
void rune::ParticleEmitter::setGravity |
( |
rune::Vec2 |
gravity | ) |
|
Sets the gravity that a particle will be subjected to.
- Parameters
-
gravity | The gravity vector that each particle will be subjected to. |
◆ setPosition()
void rune::ParticleEmitter::setPosition |
( |
rune::Vec2 |
newPos | ) |
|
- Parameters
-
newPos | The new position that the particle emitter should start generating particle from. |
◆ update()
void rune::ParticleEmitter::update |
( |
double |
dT | ) |
|
Update the position of the particles based on velocity and gravity.
- Parameters
-
dT | The amount of time that has passed since the last update call, used to update position of particles. |
The documentation for this class was generated from the following files: