Brenta Engine 1.1
|
ParticleEmitter class. More...
#include <particles.hpp>
Data Structures | |
class | builder |
Builder pattern for ParticleEmitter. More... | |
Public Member Functions | |
particle_emitter () | |
Empty constructor. | |
particle_emitter (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 *cam) | |
Construct a new ParticleEmitter object. | |
~particle_emitter () | |
Destroy the ParticleEmitter object. | |
void | update_particles (float deltaTime) |
Update the particles. | |
void | render_particles () |
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_time_to_live |
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.
particle_emitter::particle_emitter | ( | ) |
particle_emitter::particle_emitter | ( | 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 * | cam ) |
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.
particle_emitter::~particle_emitter | ( | ) |
Destroy the ParticleEmitter object.
Definition at line 125 of file particles.cpp.
void particle_emitter::render_particles | ( | ) |
Render the particles.
Definition at line 183 of file particles.cpp.
void particle_emitter::update_particles | ( | float | deltaTime | ) |
Update the particles.
deltaTime | Time passed since last frame |
Definition at line 134 of file particles.cpp.
int brenta::particle_emitter::atlas |
Atlas texture.
Definition at line 98 of file particles.hpp.
int brenta::particle_emitter::atlas_height |
Atlas height.
Definition at line 106 of file particles.hpp.
int brenta::particle_emitter::atlas_index |
Atlas index.
Definition at line 110 of file particles.hpp.
int brenta::particle_emitter::atlas_width |
Atlas width.
Definition at line 102 of file particles.hpp.
int brenta::particle_emitter::current |
Current fbo index.
Definition at line 94 of file particles.hpp.
types::buffer brenta::particle_emitter::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::particle_emitter::num_particles |
Number of particles.
Definition at line 75 of file particles.hpp.
float brenta::particle_emitter::scale |
Scale of particles.
Definition at line 83 of file particles.hpp.
float brenta::particle_emitter::spawn_rate |
Spawn rate of particles.
Definition at line 79 of file particles.hpp.
glm::vec3 brenta::particle_emitter::starting_position |
Starting position of a new particle.
Definition at line 59 of file particles.hpp.
glm::vec3 brenta::particle_emitter::starting_spread |
Starting spread of a new particle.
Definition at line 67 of file particles.hpp.
float brenta::particle_emitter::starting_time_to_live |
Time to live of a new particle.
Definition at line 71 of file particles.hpp.
glm::vec3 brenta::particle_emitter::starting_velocity |
Starting velocity of a new particle.
Definition at line 63 of file particles.hpp.
types::vao brenta::particle_emitter::vao |
Vertex array object.
Definition at line 114 of file particles.hpp.