Define a particle system ALL PARTICLE SYSTEM SHARE THE SAME PÄRTICLE SUBSET.
More...
#include <particle_system.hpp>
|
|
void | reset () |
| | reset system to zero count
|
| |
|
void | set_max_particle_count (const uint16_t _particleCount) |
| | Call when you want to change the particle count of the simulation Can be called once when starting the particle system.
|
| |
| void | init_particules (const std::function< int16_t(size_t)> &positionGeneratorFunction) |
| | Init the particles from a initialization function.
|
| |
| void | init_deferred_particules (uint8_t maxParticlesToPop, const std::function< int16_t(size_t)> &positionGeneratorFunction) |
| | Init the particles from a initialization function, in a timed defered way.
|
| |
| void | iterate_no_collisions (const utils::vec3d &accelerationCartesian, const float deltaTime_s, const bool shouldContrain=true) |
| | Advance the particle simulation, ignoring collisions.
|
| |
| void | iterate_with_collisions (const utils::vec3d &accelerationCartesian, const float deltaTime_s, const bool shouldContrain=true) |
| | Advance the particle simulation, taking collisions in account.
|
| |
| uint16_t | depop_particules (const std::function< bool(const Particle &)> &shouldDepopFunction) |
| | Filter particles depending on condition.
|
| |
| uint16_t | show (const std::function< uint32_t(int16_t, const Particle &)> sample_color, LampTy &lamp) |
| | Display this particle system.
|
| |
|
uint16_t | get_number_of_active () const |
| | Return the number of active particles.
|
| |
|
|
bool | is_position_taken (const int16_t pos) const |
| | Return True if the position is already occupied.
|
| |
| void | spawn_particule (const size_t index, const std::function< int16_t(size_t)> &positionGeneratorFunction) |
| | Spawn a particle.
|
| |
Define a particle system ALL PARTICLE SYSTEM SHARE THE SAME PÄRTICLE SUBSET.
◆ depop_particules()
| uint16_t lampda::modes::ParticleSystem::depop_particules |
( |
const std::function< bool(const Particle &)> & |
shouldDepopFunction | ) |
|
|
inline |
Filter particles depending on condition.
- Parameters
-
| [in] | shouldDepopFunction | A function, that given a particle, will return true if it needs to be removed from the simulation. |
- Returns
- The number of particles left in the simulation.
◆ init_deferred_particules()
| void lampda::modes::ParticleSystem::init_deferred_particules |
( |
uint8_t |
maxParticlesToPop, |
|
|
const std::function< int16_t(size_t)> & |
positionGeneratorFunction |
|
) |
| |
|
inline |
Init the particles from a initialization function, in a timed defered way.
- Parameters
-
| [in] | maxParticlesToPop | Maximum particles to spawn at this call |
| [in] | positionGeneratorFunction | Function that takes an index and return a led strip index |
◆ init_particules()
| void lampda::modes::ParticleSystem::init_particules |
( |
const std::function< int16_t(size_t)> & |
positionGeneratorFunction | ) |
|
|
inline |
Init the particles from a initialization function.
- Parameters
-
| [in] | positionGeneratorFunction | Function that takes an index and return a ledstrip index |
◆ iterate_no_collisions()
| void lampda::modes::ParticleSystem::iterate_no_collisions |
( |
const utils::vec3d & |
accelerationCartesian, |
|
|
const float |
deltaTime_s, |
|
|
const bool |
shouldContrain = true |
|
) |
| |
|
inline |
Advance the particle simulation, ignoring collisions.
- Parameters
-
| [in] | accelerationCartesian | 3d acceleration vector to apply to particles |
| [in] | deltaTime_s | Time since last update, in seconds |
| [in] | shouldContrain | If true, will constrain the particles to the lamp body. |
◆ iterate_with_collisions()
| void lampda::modes::ParticleSystem::iterate_with_collisions |
( |
const utils::vec3d & |
accelerationCartesian, |
|
|
const float |
deltaTime_s, |
|
|
const bool |
shouldContrain = true |
|
) |
| |
|
inline |
Advance the particle simulation, taking collisions in account.
- Parameters
-
| [in] | accelerationCartesian | 3d acceleration vector to apply to particles |
| [in] | deltaTime_s | Time since last update, in seconds |
| [in] | shouldContrain | If true, will constrain the particles to the lamp body. |
◆ show()
| uint16_t lampda::modes::ParticleSystem::show |
( |
const std::function< uint32_t(int16_t, const Particle &)> |
sample_color, |
|
|
LampTy & |
lamp |
|
) |
| |
|
inline |
Display this particle system.
- Parameters
-
| [in] | sample_color | sampling function for the particle color |
| [in,out] | lamp | The lamp object to write to |
◆ spawn_particule()
| void lampda::modes::ParticleSystem::spawn_particule |
( |
const size_t |
index, |
|
|
const std::function< int16_t(size_t)> & |
positionGeneratorFunction |
|
) |
| |
|
inlineprotected |
Spawn a particle.
- Parameters
-
| [in] | index | Index of this particle |
| [in] | positionGeneratorFunction | Spawn function |
The documentation for this class was generated from the following file: