AireEngine
A 3D Open-World Game Engine
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
Aire::ParticleGenerator Class Reference

#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 ()
 
TerraingetTerrain ()
 
void Update (float dt)
 
void renderParticles (ShaderProgram &shader, Camera &playCamera)
 

Public Attributes

std::vector< Model * > models
 Models for the particles.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ParticleGenerator() [1/2]

ParticleGenerator::ParticleGenerator ( std::vector< Model * > models,
Terrain * terrain,
unsigned int amount,
MeshManager & meshManager,
const glm::vec3 & position,
const glm::vec3 & direction,
float interval )

Constructor

Parameters
modelsGeometry resources associated with the particle
terrainThe terrain the particles will fall onto
amountNumber of particles to generate
meshManagerThe mesh manager for the models
positionDefault particle position
directionDefault particle direction
intervalThe interval (in seconds) for spawning new particles
Here is the call graph for this function:

◆ ParticleGenerator() [2/2]

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

Parameters
modelsGeometry resource associated with the particle
terrainThe terrain the particles will fall onto
amountNumber of particles to generate
meshManagerThe mesh manager for the models
rangeThe 2D rectangle in which particles will be randomly emitted
intervalThe interval (in seconds) for spawning new particles
Here is the call graph for this function:

Member Function Documentation

◆ renderParticles()

void ParticleGenerator::renderParticles ( ShaderProgram & shader,
Camera & playCamera )

Render all particles

Parameters
shaderThe shader program to use for rendering
playCameraThe camera associated with the player
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setSpeed()

void Aire::ParticleGenerator::setSpeed ( float speed)

Set the speed of the particles

Parameters
speed

◆ Update()

void ParticleGenerator::Update ( float dt)

Update all particles

Parameters
dtTime delta to drive the update
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: