Jamie Slowgrove - PGG Assignment 2
 All Classes Namespaces Files Functions Variables Typedefs Macros
Public Member Functions | Private Attributes | List of all members
ParticleEffect Class Reference

Creates a ParticleEffect object that handles Particle objects. More...

#include <ParticleEffect.h>

Collaboration diagram for ParticleEffect:
Collaboration graph

Public Member Functions

 ParticleEffect (std::string fileName, std::unordered_map< std::string, Object * > &objects, std::unordered_map< std::string, Shader * > &shaders, std::string vertexShaderName, std::string fragmentShaderName, glm::vec3 emitter, bool emit)
 
 ~ParticleEffect ()
 
void update (float dt)
 
void draw (glm::mat4 &viewMatrix, glm::mat4 &projMatrix)
 
void makeNewParticles (std::unordered_map< std::string, Object * > &objects, std::unordered_map< std::string, Shader * > &shaders)
 
void setEmitter (glm::vec3 emitter)
 
void setEmitting (bool emit)
 

Private Attributes

std::vector< Particle * > particles
 
std::unordered_map
< std::string, Object * > 
objects
 
std::unordered_map
< std::string, Shader * > 
shaders
 
std::string objectName
 
std::string vertexShaderName
 
std::string fragmentShaderName
 
float moveSpeed
 
glm::vec3 emitter
 
bool emit
 

Detailed Description

Creates a ParticleEffect object that handles Particle objects.

Author
Jamie Slowgrove

Constructor & Destructor Documentation

ParticleEffect::ParticleEffect ( std::string  fileName,
std::unordered_map< std::string, Object * > &  objects,
std::unordered_map< std::string, Shader * > &  shaders,
std::string  vertexShaderName,
std::string  fragmentShaderName,
glm::vec3  emitter,
bool  emit 
)

Constructs a ParticleEffect Object.

Parameters
objectNameThe file name of the model that the Particle will use.
objectsA reference to the loaded Object files
shadersA reference to the loaded Shader files
vertexShaderNameThe name of the vertex shader.
fragmentShaderNameThe name of the fragment shader.
emitterThe position that the particle effect emits from.
emitThe new value of the emit boolean.

Here is the call graph for this function:

ParticleEffect::~ParticleEffect ( )

Destructs a ParticleEffect Object. Destructs the ParticleEffect Object deleting the Particle Object from memory.

Member Function Documentation

void ParticleEffect::draw ( glm::mat4 &  viewMatrix,
glm::mat4 &  projMatrix 
)

Draws the ParticleEffect.

Parameters
viewMatrixA reference to the camera view matrix.
projMatrixA reference to the camera projection matrix.

Here is the caller graph for this function:

void ParticleEffect::makeNewParticles ( std::unordered_map< std::string, Object * > &  objects,
std::unordered_map< std::string, Shader * > &  shaders 
)

Creates the new Particle objects.

Parameters
objectsA reference to the loaded Object files
shadersA reference to the loaded Shader files

Here is the caller graph for this function:

void ParticleEffect::setEmitter ( glm::vec3  emitter)

Setter # The position of the emitter.

Parameters
emitterThe new position of the emitter.

Here is the caller graph for this function:

void ParticleEffect::setEmitting ( bool  emit)

Setter # The value of the emit boolean.

Parameters
emitThe new value of the emit boolean.

Here is the caller graph for this function:

void ParticleEffect::update ( float  dt)

A function that updates the ParticleEffect

Parameters
dtThe delta time.

Here is the caller graph for this function:

Member Data Documentation

bool ParticleEffect::emit
private

A boolean for if the ParticleEffect should emit

glm::vec3 ParticleEffect::emitter
private

The position of the Particle emitter

std::string ParticleEffect::fragmentShaderName
private

The name of the fragment shader

float ParticleEffect::moveSpeed
private

The move speed of the particles

std::string ParticleEffect::objectName
private

The name of the object for the model

std::unordered_map<std::string, Object*> ParticleEffect::objects
private

The loaded Object files

std::vector<Particle*> ParticleEffect::particles
private

A vector of Particle objects

std::unordered_map<std::string, Shader*> ParticleEffect::shaders
private
std::string ParticleEffect::vertexShaderName
private

The name of the vertex shader


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