|
Brenta Engine 1.0
|
ParticleEmitter class. More...
#include <particles.hpp>
Data Structures | |
| class | Builder |
| Builder pattern for ParticleEmitter. More... | |
Public Member Functions | |
| ParticleEmitter () | |
| Empty constructor. | |
| ParticleEmitter (glm::vec3 starting_position, glm::vec3 starting_velocity, glm::vec3 starting_spread, float starting_timeToLive, int num_particles, float spawn_rate, float scale, std::string atlas_path, int atlas_width, int atlas_height, int atlas_index, Camera *camera) | |
| Construct a new ParticleEmitter object. | |
| ~ParticleEmitter () | |
| Destroy the ParticleEmitter object. | |
| void | updateParticles (float deltaTime) |
| Update the particles. | |
| void | renderParticles () |
| Render the particles. | |
Data Fields | |
| glm::vec3 | starting_position |
| Starting position of a new particle. | |
| glm::vec3 | starting_velocity |
| Starting velocity of a new particle. | |
| glm::vec3 | starting_spread |
| Starting spread of a new particle. | |
| float | starting_timeToLive |
| Time to live of a new particle. | |
| int | num_particles |
| Number of particles. | |
| float | spawn_rate |
| Spawn rate of particles. | |
| float | scale |
| Scale of particles. | |
| Types::Buffer | fbo [2] |
| Feddback buffer objects. | |
| int | current |
| Current fbo index. | |
| int | atlas |
| Atlas texture. | |
| int | atlas_width |
| Atlas width. | |
| int | atlas_height |
| Atlas height. | |
| int | atlas_index |
| Atlas index. | |
| Types::VAO | vao |
| Vertex array object. | |
ParticleEmitter class.
This class is used to define a particle emitter, update and render its particles. This class provides a builder pattern to create a ParticleEmitter object. The particles ban be updated and rendered using the updateParticles and renderParticles methods.
Definition at line 53 of file particles.hpp.
| ParticleEmitter::ParticleEmitter | ( | ) |
| ParticleEmitter::ParticleEmitter | ( | glm::vec3 | starting_position, |
| glm::vec3 | starting_velocity, | ||
| glm::vec3 | starting_spread, | ||
| float | starting_timeToLive, | ||
| int | num_particles, | ||
| float | spawn_rate, | ||
| float | scale, | ||
| std::string | atlas_path, | ||
| int | atlas_width, | ||
| int | atlas_height, | ||
| int | atlas_index, | ||
| Camera * | camera ) |
Construct a new ParticleEmitter object.
| starting_position | Starting position of a new particle |
| starting_velocity | Starting velocity of a new particle |
| starting_spread | Starting spread of a new particle |
| starting_timeToLive | Time to live of a new particle |
| num_particles | Number of particles |
| spawn_rate | Spawn rate of particles |
| scale | Scale of particles |
| atlas_path | Atlas texture path |
| atlas_width | Atlas width |
| atlas_height | Atlas height |
| atlas_index | Atlas index |
| camera | Camera |
Definition at line 57 of file particles.cpp.
| ParticleEmitter::~ParticleEmitter | ( | ) |
Destroy the ParticleEmitter object.
Definition at line 123 of file particles.cpp.
| void ParticleEmitter::renderParticles | ( | ) |
Render the particles.
Definition at line 181 of file particles.cpp.
| void ParticleEmitter::updateParticles | ( | float | deltaTime | ) |
Update the particles.
| deltaTime | Time passed since last frame |
Definition at line 132 of file particles.cpp.
| int Brenta::ParticleEmitter::atlas |
Atlas texture.
Definition at line 98 of file particles.hpp.
| int Brenta::ParticleEmitter::atlas_height |
Atlas height.
Definition at line 106 of file particles.hpp.
| int Brenta::ParticleEmitter::atlas_index |
Atlas index.
Definition at line 110 of file particles.hpp.
| int Brenta::ParticleEmitter::atlas_width |
Atlas width.
Definition at line 102 of file particles.hpp.
| int Brenta::ParticleEmitter::current |
Current fbo index.
Definition at line 94 of file particles.hpp.
| Types::Buffer Brenta::ParticleEmitter::fbo[2] |
Feddback buffer objects.
These are used to save the new state of updated particles in the updateParticles method.
Definition at line 90 of file particles.hpp.
| int Brenta::ParticleEmitter::num_particles |
Number of particles.
Definition at line 75 of file particles.hpp.
| float Brenta::ParticleEmitter::scale |
Scale of particles.
Definition at line 83 of file particles.hpp.
| float Brenta::ParticleEmitter::spawn_rate |
Spawn rate of particles.
Definition at line 79 of file particles.hpp.
| glm::vec3 Brenta::ParticleEmitter::starting_position |
Starting position of a new particle.
Definition at line 59 of file particles.hpp.
| glm::vec3 Brenta::ParticleEmitter::starting_spread |
Starting spread of a new particle.
Definition at line 67 of file particles.hpp.
| float Brenta::ParticleEmitter::starting_timeToLive |
Time to live of a new particle.
Definition at line 71 of file particles.hpp.
| glm::vec3 Brenta::ParticleEmitter::starting_velocity |
Starting velocity of a new particle.
Definition at line 63 of file particles.hpp.
| Types::VAO Brenta::ParticleEmitter::vao |
Vertex array object.
Definition at line 114 of file particles.hpp.