A container for holding and updating particles that are all the same type.
More...
#include <ParticleBlock.h>
|
| auto | activeParticles () const |
| | returns a list of the indices where there are active particles
|
| auto | addParticleAtPosition (const Particle &particle, unsigned pos) -> void |
| | helper function to add a particle at a specific point in the arrays
|
| auto | pushBackParticle (const Particle &particle) -> void |
| | helper function to add a particle to the ends of the arrays
|
| auto | updateAnimationForParticle (float dt, unsigned particlePosition) -> void |
| | helper function to run animation logic for a specific particle (called in loop for every particle)
|
A container for holding and updating particles that are all the same type.
ParticleBlock used and owned by ParticleEmitter, and shared with sys::ParticleManager. Takes in particles as an Array of Structs, and stores them as a Struct of Arrays, for performance
◆ ParticleBlock()
| ParticleBlock::ParticleBlock |
( |
| ) |
|
|
default |
◆ activeParticles()
| auto ParticleBlock::activeParticles |
( |
| ) |
const |
|
inlineprivate |
returns a list of the indices where there are active particles
◆ addParticleAtPosition()
| auto ParticleBlock::addParticleAtPosition |
( |
const Particle & | particle, |
|
|
unsigned | pos )->void |
|
private |
helper function to add a particle at a specific point in the arrays
a local macro to simplify adding a particle to the arrays
◆ addParticles()
| auto ParticleBlock::addParticles |
( |
const std::vector< Particle > & | particles | ) |
->void |
Add a series of particles to the block.
- Parameters
-
| particles | a reference to a vector of particles to add |
◆ destroy()
| auto ParticleBlock::destroy |
( |
| ) |
->void |
◆ destroyed()
| auto ParticleBlock::destroyed |
( |
| ) |
const->bool |
◆ getName()
| auto ParticleBlock::getName |
( |
| ) |
const->conststd::string & |
◆ pushBackParticle()
| auto ParticleBlock::pushBackParticle |
( |
const Particle & | particle | ) |
->void |
|
private |
helper function to add a particle to the ends of the arrays
A local macro to simply the duplicate code of adding values to particles
◆ render()
| auto ParticleBlock::render |
( |
| ) |
const->void |
◆ setMesh()
| auto ParticleBlock::setMesh |
( |
gfx::Mesh * | mesh | ) |
->void |
◆ setName()
| auto ParticleBlock::setName |
( |
std::string | newName | ) |
->void |
◆ setShader()
| auto ParticleBlock::setShader |
( |
gfx::Shader * | shader | ) |
->void |
◆ setTexture()
| auto ParticleBlock::setTexture |
( |
gfx::Texture * | texture | ) |
->void |
◆ showMenu()
| auto ParticleBlock::showMenu |
( |
| ) |
->void |
draw a table with the stats of every particle
◆ update()
| auto ParticleBlock::update |
( |
float | dt | ) |
->void |
- Parameters
-
| dt | time in seconds that have passed |
◆ updateAnimationForParticle()
| auto ParticleBlock::updateAnimationForParticle |
( |
float | dt, |
|
|
unsigned | particlePosition )->void |
|
private |
helper function to run animation logic for a specific particle (called in loop for every particle)
◆ color
| std::vector<Vector4D> ParticleBlock::color |
|
private |
◆ colorBegin
| std::vector<Vector4D> ParticleBlock::colorBegin |
|
private |
◆ colorChanges
| bool ParticleBlock::colorChanges = false |
|
private |
◆ colorCurve
◆ colorEnd
| std::vector<Vector4D> ParticleBlock::colorEnd |
|
private |
◆ frame
| std::vector<unsigned> ParticleBlock::frame |
|
private |
◆ frameCountdown
| std::vector<float> ParticleBlock::frameCountdown |
|
private |
◆ frameTime
| float ParticleBlock::frameTime = 0.f |
|
private |
◆ isDestroyed
| bool ParticleBlock::isDestroyed = false |
|
private |
◆ lifetime
| std::vector<float> ParticleBlock::lifetime |
|
private |
◆ loops
| bool ParticleBlock::loops = false |
|
private |
◆ mesh
◆ name
| std::string ParticleBlock::name |
|
private |
The name of the block of particles, for user reference. This name is set by the particleEmitter it's owned by.
◆ normalizedAge
| std::vector<float> ParticleBlock::normalizedAge |
|
private |
◆ particleCount
| unsigned ParticleBlock::particleCount = 0u |
|
private |
◆ position
| std::vector<Vector4D> ParticleBlock::position |
|
private |
◆ rotation
| std::vector<float> ParticleBlock::rotation |
|
private |
◆ rotationalAcceleration
| std::vector<float> ParticleBlock::rotationalAcceleration |
|
private |
◆ rotationalVelocity
| std::vector<float> ParticleBlock::rotationalVelocity |
|
private |
◆ scale
| std::vector<Vector4D> ParticleBlock::scale |
|
private |
◆ scaleBegin
| std::vector<Vector4D> ParticleBlock::scaleBegin |
|
private |
◆ scaleChanges
| bool ParticleBlock::scaleChanges = false |
|
private |
◆ scaleCurve
◆ scaleEnd
| std::vector<Vector4D> ParticleBlock::scaleEnd |
|
private |
◆ shader
◆ texture
◆ timeLeft
| std::vector<float> ParticleBlock::timeLeft |
|
private |
how long the particle has before it is dead, if less than 0, particle is inactive
◆ totalFrames
| unsigned ParticleBlock::totalFrames = texture->getFrames() |
|
private |
◆ velocity
| std::vector<Vector4D> ParticleBlock::velocity |
|
private |
◆ velocityBegin
| std::vector<Vector4D> ParticleBlock::velocityBegin |
|
private |
◆ velocityChanges
| bool ParticleBlock::velocityChanges = false |
|
private |
◆ velocityCurve
◆ velocityEnd
| std::vector<Vector4D> ParticleBlock::velocityEnd |
|
private |
The documentation for this class was generated from the following files: