Castor3D 0.16.0
Multiplatform 3D engine
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
castor3d::CpuParticleSystem Class Referenceabstract

#include <CpuParticleSystem.hpp>

Inheritance diagram for castor3d::CpuParticleSystem:
Inheritance graph
[legend]
Collaboration diagram for castor3d::CpuParticleSystem:
Collaboration graph
[legend]

Public Member Functions

C3D_API CpuParticleSystem (ParticleSystem &parent)
 Constructor.
 
C3D_API bool initialise (RenderDevice const &device) override
 Initialises the implementation.
 
C3D_API void cleanup (RenderDevice const &device) override
 Cleans the implementation.
 
C3D_API void update (castor3d::CpuUpdater &updater) override
 Updates the render pass, CPU wise.
 
C3D_API uint32_t update (castor3d::GpuUpdater &updater) override
 Updates the render pass, CPU wise.
 
C3D_API void addParticleVariable (castor::String const &name, ParticleFormat type, castor::String const &defaultValue) override
 adds a particle variable.
 
- Public Member Functions inherited from castor3d::ParticleSystemImpl
C3D_API ParticleSystemImpl (Type type, ParticleSystem &parent)
 Constructor.
 
virtual C3D_API ~ParticleSystemImpl () noexcept=default
 Destructor.
 
Type getType ()
 
ParticleSystem const & getParent () const
 

Protected Member Functions

C3D_API ParticleEmitteraddEmitter (ParticleEmitterUPtr emitter)
 Adds the given emitter to the list.
 
C3D_API ParticleUpdateraddUpdater (ParticleUpdaterUPtr updater)
 Adds the given updater to the list.
 
C3D_API void onEmit (Particle const &particle)
 Called when a particle is emitted.
 

Protected Attributes

ParticleDeclaration m_inputs
 
ParticleArray m_particles
 
ParticleEmitterArray m_emitters
 
ParticleUpdaterArray m_updaters
 
uint32_t m_firstUnused { 1u }
 
- Protected Attributes inherited from castor3d::ParticleSystemImpl
ParticleSystemm_parent
 
Type m_type
 

Additional Inherited Members

- Public Types inherited from castor3d::ParticleSystemImpl
enum class  Type { eCpu = 0 , eComputeShader = 1 , eCount , eMin = eCpu }
 Particle system implementation types enumeration. More...
 

Constructor & Destructor Documentation

◆ CpuParticleSystem()

C3D_API castor3d::CpuParticleSystem::CpuParticleSystem ( ParticleSystem & parent)
explicit

Constructor.

Parameters
[in]parentThe parent particle system.

Member Function Documentation

◆ addEmitter()

C3D_API ParticleEmitter * castor3d::CpuParticleSystem::addEmitter ( ParticleEmitterUPtr emitter)
protected

Adds the given emitter to the list.

◆ addParticleVariable()

C3D_API void castor3d::CpuParticleSystem::addParticleVariable ( castor::String const & name,
ParticleFormat type,
castor::String const & defaultValue )
overridevirtual

adds a particle variable.

Parameters
[in]nameThe variable name.
[in]typeThe variable type.
[in]defaultValueThe variable default value.

Implements castor3d::ParticleSystemImpl.

◆ addUpdater()

C3D_API ParticleUpdater * castor3d::CpuParticleSystem::addUpdater ( ParticleUpdaterUPtr updater)
protected

Adds the given updater to the list.

◆ cleanup()

C3D_API void castor3d::CpuParticleSystem::cleanup ( RenderDevice const & device)
overridevirtual

Cleans the implementation.

Parameters
deviceThe current device.

Implements castor3d::ParticleSystemImpl.

◆ initialise()

C3D_API bool castor3d::CpuParticleSystem::initialise ( RenderDevice const & device)
overridevirtual

Initialises the implementation.

Parameters
deviceThe current device.
Returns
true if all is OK.

Implements castor3d::ParticleSystemImpl.

◆ onEmit()

C3D_API void castor3d::CpuParticleSystem::onEmit ( Particle const & particle)
protected

Called when a particle is emitted.

◆ update() [1/2]

C3D_API void castor3d::CpuParticleSystem::update ( castor3d::CpuUpdater & updater)
overridevirtual

Updates the render pass, CPU wise.

Parameters
[in,out]updaterThe update data.

Implements castor3d::ParticleSystemImpl.

◆ update() [2/2]

C3D_API uint32_t castor3d::CpuParticleSystem::update ( castor3d::GpuUpdater & updater)
overridevirtual

Updates the render pass, CPU wise.

Parameters
[in,out]updaterThe update data.

Implements castor3d::ParticleSystemImpl.

Member Data Documentation

◆ m_emitters

ParticleEmitterArray castor3d::CpuParticleSystem::m_emitters
protected

The particles emitters.

◆ m_firstUnused

uint32_t castor3d::CpuParticleSystem::m_firstUnused { 1u }
protected

The first unused particle data.

◆ m_inputs

ParticleDeclaration castor3d::CpuParticleSystem::m_inputs
protected

The particle's elements description.

◆ m_particles

ParticleArray castor3d::CpuParticleSystem::m_particles
protected

The particles.

◆ m_updaters

ParticleUpdaterArray castor3d::CpuParticleSystem::m_updaters
protected

The particles updaters.


The documentation for this class was generated from the following file: