Class ParticleSystemBase

Inheritance Relationships

Derived Type

Class Documentation

class legion::rendering::ParticleSystemBase

Base class to be used as a template for the creation of particle systems.

Subclassed by PointCloudParticleSystem

Public Functions

virtual ~ParticleSystemBase() = default
virtual void setup(ecs::component_handle<particle_emitter> particle_emitter) const

The function that is run to setup all the particles inside of the given emitter.

Parameters
  • particle_emitter: The particle emitter that holds the particles that you plan to iterate over.

virtual void update(std::vector<ecs::entity_handle> &particle_list, ecs::component_handle<particle_emitter> particle_emitter, ecs::EntityQuery &entities, time::span delta_time) const

The function that runs every frame to update all the particles inside of the given emitter.

Parameters
  • particle_list: A list of particles to iterate over.

  • particle_emitter: The emitter component handle holding the particles.

Protected Functions

virtual void createParticle(ecs::entity_handle ent) const

The function used to populate particles with data.

Parameters
  • particleHandle: The particle that you want to populate.

  • transformHandle: The transform component of the particle.

virtual void cleanUpParticle(ecs::entity_handle particleHandle, particle_emitter &emitterHandle) const

The function used to clean up particles that have outlived their lifeTime.

Parameters
  • particleHandle: The particle that is to be cleaned up.

  • emitterHandle: The emitter that hold that particular particle.

ecs::component_handle<particle> checkToRecycle(particle_emitter &emitterHandle) const

Checks if the given emitter has a particle ready to be used, otherwise make a new one.

Parameters
  • emitterHandle: The emitter that is being checked for an available particle.

Protected Attributes

bool m_looping
float m_maxLifeTime
float m_startingLifeTime
uint m_spawnRate
uint m_particleCount
uint m_maxParticles
math::vec3 m_startingVelocity
math::vec3 m_startingSize
float m_sizeOverLifetime
material_handle m_particleMaterial
model_handle m_particleModel

Protected Static Attributes

static ecs::EcsRegistry *m_registry