class
#include <nCine/Graphics/ParticleSystem.h>
ParticleSystem Represents a particle system.
Base classes
- class SceneNode
- Base class for the transformation nodes hierarchy.
Public static functions
- static auto sType() -> ObjectType
Constructors, destructors, conversion operators
-
ParticleSystem(SceneNode* parent,
std::
uint32_t count, Texture* texture) - Constructs a particle system with the specified maximum amount of particles.
-
ParticleSystem(SceneNode* parent,
std::
uint32_t count, Texture* texture, Recti texRect) - Constructs a particle system with the specified maximum amount of particles and the specified texture rectangle.
- ~ParticleSystem() override
- ParticleSystem(ParticleSystem&&)
- ParticleSystem(const ParticleSystem& other) protected
- Protected copy constructor used to clone objects.
Public functions
- auto operator=(const ParticleSystem&) -> ParticleSystem& deleted
- auto operator=(ParticleSystem&&) -> ParticleSystem&
- auto clone() const -> ParticleSystem
- Returns a copy of this object.
-
void addAffector(std::
unique_ptr<ParticleAffector> affector) - Adds a particle affector.
- void clearAffectors()
- Deletes all particle affectors.
- void emitParticles(const ParticleInitializer& init)
- Emits particles with the specified initialization parameters.
- void killParticles()
- Kills all alive particles.
- auto inLocalSpace() const -> bool
- Returns the local space flag of the system.
- void setInLocalSpace(bool inLocalSpace)
- Sets the local space flag of the system.
-
auto numParticles() const -> std::
uint32_t - Returns the total number of particles in the system.
-
auto numAliveParticles() const -> std::
uint32_t - Returns the number of particles currently alive.
- void setTexture(Texture* texture)
- Sets the texture object for every particle.
- void setTexRect(const Recti& rect)
- Sets the texture source rectangle for every particle.
- void setAnchorPoint(float xx, float yy)
- Sets the transformation anchor point for every particle.
- void setAnchorPoint(Vector2f point)
- Sets the transformation anchor point for every particle with a
Vector2f
- void setFlippedX(bool flippedX)
- Flips the texture rect horizontally for every particle.
- void setFlippedY(bool flippedY)
- Flips the texture rect vertically for every particle.
-
void setBlendingPreset(DrawableNode::
BlendingPreset blendingPreset) - Sets the blending factors preset for every particle.
-
void setBlendingFactors(DrawableNode::
BlendingFactor srcBlendingFactor, DrawableNode:: BlendingFactor destBlendingFactor) - Sets the source and destination blending factors for every particle.
- void setLayer(uint16_t layer)
- Sets the rendering layer for every particle.
- void OnUpdate(float timeMult) override
- Called every frame to update the object state.