Confetti  0.1.0
A C++ particle system using Vulkan
Public Member Functions | List of all members
Confetti::ParticleSystem Class Reference

The particle system. More...

#include <Confetti/ParticleSystem.h>

Public Member Functions

 ParticleSystem (std::shared_ptr< Vkx::Device > device, vk::CommandPool const &commandPool, vk::Queue const &queue)
 Constructor. More...
 
void update (float dt)
 Updates the system. More...
 
void draw () const
 Draws all particles for all the emitters.
 
void add (std::shared_ptr< BasicEmitter > pemitter)
 Registers a component. More...
 
void add (std::shared_ptr< Appearance > appearance)
 
void add (std::shared_ptr< Environment > environment)
 
bool remove (BasicEmitter *emitter)
 Unregisters a component. More...
 
bool remove (Appearance *appearance)
 
bool remove (Environment *environment)
 

Detailed Description

The particle system.

This class updates and draws particles associated with a set of emitters using a set of appearances and environments.

Constructor & Destructor Documentation

◆ ParticleSystem()

Confetti::ParticleSystem::ParticleSystem ( std::shared_ptr< Vkx::Device >  device,
vk::CommandPool const &  commandPool,
vk::Queue const &  queue 
)

Constructor.

Parameters
deviceDevice to draw the particle system on

Member Function Documentation

◆ add() [1/3]

void Confetti::ParticleSystem::add ( std::shared_ptr< BasicEmitter emitter)

Registers a component.

Parameters
emitterThe emitter to register.

◆ add() [2/3]

void Confetti::ParticleSystem::add ( std::shared_ptr< Appearance appearance)
Parameters
appearanceThe appearance to register.

◆ add() [3/3]

void Confetti::ParticleSystem::add ( std::shared_ptr< Environment environment)
Parameters
environmentThe environment to register.

◆ remove() [1/3]

bool Confetti::ParticleSystem::remove ( BasicEmitter emitter)

Unregisters a component.

Parameters
emitterThe emitter to unregister.
Returns
false, if the emitter was not registered

◆ remove() [2/3]

bool Confetti::ParticleSystem::remove ( Appearance appearance)
Parameters
appearanceThe appearance to unregister.
Returns
false, if the appearance was not registered

◆ remove() [3/3]

bool Confetti::ParticleSystem::remove ( Environment environment)
Parameters
environmentThe environment to unregister.
Returns
false, if the appearance was not registered

◆ update()

void Confetti::ParticleSystem::update ( float  dt)

Updates the system.

Parameters
dtAmount of time (seconds) that has passed since the last update.