A point Particle scaled by distance.
More...
#include <Confetti/PointParticle.h>
|
| PointParticle ()=default |
| Constructor.
|
|
| PointParticle (float lifetime, float age, glm::vec3 const &position, glm::vec3 const &velocity, glm::vec4 const &color) |
| Constructor. More...
|
|
virtual | ~PointParticle () override=default |
| Destructor.
|
|
void | Initialize (float lifetime, float age, glm::vec3 const &position, glm::vec3 const &velocity, glm::vec4 const &color) |
| Initializes a particle constructed with the default constructor.
|
|
|
virtual bool | update (float dt) override |
| Updates the particle. Returns true if the particle was reborn. More...
|
|
virtual void | draw (std::shared_ptr< Vkx::Device > device) const override |
| Draws the particle. More...
|
|
Public Member Functions inherited from Confetti::Particle |
| Particle ()=default |
| Constructor.
|
|
| Particle (float lifetime, float age, glm::vec3 const &position, glm::vec3 const &velocity, glm::vec4 const &color) |
| Constructor. More...
|
|
virtual | ~Particle ()=default |
| Destructor.
|
|
void | bind (BasicEmitter *pEmitter) |
| Binds to an emitter.
|
|
float | age () const |
| Returns the age of the particle.
|
|
glm::vec3 | position () const |
| Returns the particle's current position.
|
|
glm::vec3 | velocity () const |
| Returns the particle's current velocity.
|
|
glm::vec4 | color () const |
| Returns the particle's current velocity.
|
|
A point Particle scaled by distance.
◆ PointParticle()
Confetti::PointParticle::PointParticle |
( |
float |
lifetime, |
|
|
float |
age, |
|
|
glm::vec3 const & |
position, |
|
|
glm::vec3 const & |
velocity, |
|
|
glm::vec4 const & |
color |
|
) |
| |
Constructor.
- Parameters
-
lifetime | How long the particle lives. |
age | Initial age. |
position | Position at birth. |
velocity | Velocity at birth. |
color | Color at birth. |
◆ draw()
void Confetti::PointParticle::draw |
( |
std::shared_ptr< Vkx::Device > |
device | ) |
const |
|
overridevirtual |
◆ update()
bool Confetti::PointParticle::update |
( |
float |
dt | ) |
|
|
overridevirtual |
Updates the particle. Returns true if the particle was reborn.
- Parameters
-
dt | The amount of time that has passed since the last update. |
- Note
- Methods overriding this method must call this first in order to determine the particle's age and if it has been reborn or not.
Reimplemented from Confetti::Particle.