nCine::Particle class

Renders a single particle.

Base classes

class Sprite
Scene node representing a regular sprite.

Constructors, destructors, conversion operators

Particle(SceneNode* parent, Texture* texture)
Constructor for a particle with a parent and texture, positioned in the relative origin.
Particle(Particle&&) defaulted
Particle(const Particle& other) protected
Protected copy constructor used to clone objects.

Public functions

auto operator=(Particle&&) -> Particle& defaulted
auto isAlive() const -> bool
Returns true if the particle is still alive.

Public variables

float life_
Current particle remaining life in seconds.
float startingLife
Initial particle remaining life.
float startingRotation
Initial particle rotation.
Vector2f velocity_
Current particle velocity vector.
bool inLocalSpace_
Flag indicating if particle transformations are in local space or not.

Protected functions

auto clone() const -> Particle
Returns a copy of this object.

Private functions

void OnUpdate(float timeMult) override
Updates particle data after the specified amount of seconds has passed.
void transform() override
Custom transform method to allow independent position from parent.

Function documentation

Particle nCine::Particle::clone() const protected

Returns a copy of this object.