A particle emitter.
More...
#include <Confetti/Emitter.h>
|
Vkx::LocalBuffer | vertexes_ |
|
Vkx::LocalBuffer | indexes_ |
|
std::shared_ptr< Vkx::Device > | device_ |
|
A particle emitter.
- Note
- This class is an abstract base class and must be derived from in order to be used.
◆ BasicEmitter()
Confetti::BasicEmitter::BasicEmitter |
( |
std::shared_ptr< Vkx::Device > |
device, |
|
|
std::shared_ptr< EmitterVolume > |
volume, |
|
|
std::shared_ptr< Environment > |
environment, |
|
|
std::shared_ptr< Appearance > |
appearance, |
|
|
bool |
sorted |
|
) |
| |
Constructor.
- Parameters
-
volume | Emitter volume. |
environment | Environment applied to all particles. |
appearance | Appearance shared by all particles. |
sorted | True, if the particles should be sorted back-to-front when updated |
◆ draw()
virtual void Confetti::BasicEmitter::draw |
( |
| ) |
const |
|
pure virtual |
◆ enable()
bool Confetti::BasicEmitter::enable |
( |
bool |
enable = true | ) |
|
Enables/Disables the emitter. Returns the previous state.
- Parameters
-
enabled | If true, the emitter is enabled, otherwise the emitter is disabled. |
◆ update() [1/3]
void Confetti::BasicEmitter::update |
( |
glm::vec3 const & |
position, |
|
|
glm::vec3 const & |
velocity |
|
) |
| |
Sets the emitter's position and velocity.
- Parameters
-
position | The new position of the emitter. |
velocity | The new velocity of the emitter. |
◆ update() [2/3]
void Confetti::BasicEmitter::update |
( |
float |
dt, |
|
|
glm::vec3 const & |
position, |
|
|
glm::vec3 const & |
velocity |
|
) |
| |
Updates the emitter and its particles.
- Parameters
-
dt | Amount of time elapsed since the last update |
position | The new position of the emitter. |
velocity | The new velocity of the emitter. |
◆ update() [3/3]
virtual void Confetti::BasicEmitter::update |
( |
float |
dt | ) |
|
|
pure virtual |