nCine  2025.04.r498-9d36345
A cross-platform 2D game engine
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ncine::ParticleAffector Class Referenceabstract

Base class for particle affectors. More...

#include <ParticleAffectors.h>

Inheritance diagram for ncine::ParticleAffector:
Inheritance graph
[legend]

Public Types

enum class  Type {
  COLOR , SIZE , ROTATION , POSITION ,
  VELOCITY
}
 

Public Member Functions

 ParticleAffector (Type type)
 
void affect (Particle *particle)
 Affects a property of the specified particle.
 
virtual void affect (Particle *particle, float normalizedAge)=0
 Affects a property of the specified particle, without calculating the normalized age.
 
Type type () const
 Returns the affector type.
 
bool isEnabled () const
 Returns true if the affector is enabled.
 
void setEnabled (bool enabled)
 Enables or disables the affector.
 
virtual unsigned int numSteps () const =0
 Returns the number of steps.
 
virtual void removeStep (unsigned int index)=0
 Removes the step at the specified position index.
 
virtual void clearSteps ()=0
 Removes all steps.
 

Protected Member Functions

 ParticleAffector (const ParticleAffector &other)=default
 Protected default copy constructor used to clone objects.
 

Protected Attributes

Type type_
 Affector type.
 
bool enabled_
 A flag indicating whether the affector is enabled or not.
 

Detailed Description

Base class for particle affectors.

Affectors modify particle properties depending on their remaining life


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