![]() |
AireEngine
A 3D Open-World Game Engine
|
#include <Particle.h>
Public Member Functions | |
| ParticleGenerator (std::vector< Model * > models, Terrain *terrain, unsigned int amount, MeshManager &meshManager, const glm::vec3 &position, const glm::vec3 &direction, float interval) | |
| ParticleGenerator (std::vector< Model * > models, Terrain *terrain, unsigned int amount, MeshManager &meshManager, Rectangle range, float interval) | |
| void | setSpeed (float speed) |
| std::vector< Particle > & | getParticles () |
| Terrain * | getTerrain () |
| void | Update (float dt) |
| void | renderParticles (ShaderProgram &shader, Camera &playCamera) |
Public Attributes | |
| std::vector< Model * > | models |
| Models for the particles. | |
ParticleGenerator acts as a container for rendering a large number of particles by repeatedly spawning and updating particles and killing them after a given amount of time.
| ParticleGenerator::ParticleGenerator | ( | std::vector< Model * > | models, |
| Terrain * | terrain, | ||
| unsigned int | amount, | ||
| MeshManager & | meshManager, | ||
| const glm::vec3 & | position, | ||
| const glm::vec3 & | direction, | ||
| float | interval ) |
Constructor
| models | Geometry resources associated with the particle |
| terrain | The terrain the particles will fall onto |
| amount | Number of particles to generate |
| meshManager | The mesh manager for the models |
| position | Default particle position |
| direction | Default particle direction |
| interval | The interval (in seconds) for spawning new particles |

| Aire::ParticleGenerator::ParticleGenerator | ( | std::vector< Model * > | models, |
| Terrain * | terrain, | ||
| unsigned int | amount, | ||
| MeshManager & | meshManager, | ||
| Rectangle | range, | ||
| float | interval ) |
Constructor for particles in a given 2D range
| models | Geometry resource associated with the particle |
| terrain | The terrain the particles will fall onto |
| amount | Number of particles to generate |
| meshManager | The mesh manager for the models |
| range | The 2D rectangle in which particles will be randomly emitted |
| interval | The interval (in seconds) for spawning new particles |

| void ParticleGenerator::renderParticles | ( | ShaderProgram & | shader, |
| Camera & | playCamera ) |
Render all particles
| shader | The shader program to use for rendering |
| playCamera | The camera associated with the player |


Set the speed of the particles
| speed |
Update all particles
| dt | Time delta to drive the update |

