nCine 2025.06.r503-ff15d8d
A cross-platform 2D game engine
Loading...
Searching...
No Matches
Classes | Public Member Functions | Protected Member Functions | List of all members
ncine::PositionAffector Class Reference

Particle position affector. More...

#include <ParticleAffectors.h>

Inheritance diagram for ncine::PositionAffector:
Inheritance graph
[legend]
Collaboration diagram for ncine::PositionAffector:
Collaboration graph
[legend]

Classes

struct  PositionStep
 

Public Member Functions

 PositionAffector (PositionAffector &&)=default
 Default move constructor.
 
PositionAffectoroperator= (PositionAffector &&)=default
 Default move assignment operator.
 
PositionAffector clone () const
 Returns a copy of this object.
 
void affect (Particle *particle, float normalizedAge) override
 Affects the position of the specified particle.
 
void addPositionStep (float age, float posX, float posY)
 
void addPositionStep (float age, const Vector2f &position)
 
void addPositionStep (const PositionStep &step)
 
unsigned int numSteps () const override
 Returns the number of steps.
 
void removeStep (unsigned int index) override
 Removes the step at the specified position index.
 
void clearSteps () override
 Removes all steps.
 
nctl::Array< PositionStep > & steps ()
 
const nctl::Array< PositionStep > & steps () const
 
- Public Member Functions inherited from ncine::ParticleAffector
 ParticleAffector (Type type)
 
void affect (Particle *particle)
 Affects a property of the specified particle.
 
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.
 

Protected Member Functions

 PositionAffector (const PositionAffector &other)=default
 Protected default copy constructor used to clone objects.
 
- Protected Member Functions inherited from ncine::ParticleAffector
 ParticleAffector (const ParticleAffector &other)=default
 Protected default copy constructor used to clone objects.
 

Additional Inherited Members

- Public Types inherited from ncine::ParticleAffector
enum class  Type {
  COLOR , SIZE , ROTATION , POSITION ,
  VELOCITY
}
 
- Protected Attributes inherited from ncine::ParticleAffector
Type type_
 Affector type.
 
bool enabled_
 A flag indicating whether the affector is enabled or not.
 

Detailed Description

Particle position affector.

Member Function Documentation

◆ affect()

void ncine::PositionAffector::affect ( Particle particle,
float  normalizedAge 
)
overridevirtual

Affects the position of the specified particle.

Implements ncine::ParticleAffector.

◆ clearSteps()

void ncine::PositionAffector::clearSteps ( )
inlineoverridevirtual

Removes all steps.

Implements ncine::ParticleAffector.

◆ numSteps()

unsigned int ncine::PositionAffector::numSteps ( ) const
inlineoverridevirtual

Returns the number of steps.

Implements ncine::ParticleAffector.

◆ removeStep()

void ncine::PositionAffector::removeStep ( unsigned int  index)
overridevirtual

Removes the step at the specified position index.

Implements ncine::ParticleAffector.


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