ColorAffector class
#include <nCine/Graphics/ParticleAffectors.h>
Affector that animates the color of a particle.
Linearly interpolates the particle color between consecutive ColorStep entries ordered by age.
Base classes
- class ParticleAffector
- Base class for all particle affectors.
Public types
- struct ColorStep
- A color keyed to a normalized particle age.
Constructors, destructors, conversion operators
- ColorAffector()
- ColorAffector(ColorAffector&&) defaulted
- Default move constructor.
- ColorAffector(const ColorAffector& other) protected defaulted
- Protected default copy constructor used to clone objects.
Public functions
- auto operator=(ColorAffector&&) -> ColorAffector& defaulted
- Default move assignment operator.
- auto clone() const -> ColorAffector
- Returns a copy of this object.
- void affect(Particle* particle, float normalizedAge) override
- Affects a property of the specified particle using a precomputed normalized age.
- void addColorStep(float age, const Colorf& color)
- Appends a color step at the specified age.
- auto steps() -> SmallVectorImpl<ColorStep>&
- Returns the array of color steps.
- auto steps() const -> const SmallVectorImpl<ColorStep>&
- Returns the array of color steps (read-only).
Function documentation
void nCine:: ColorAffector:: addColorStep(float age,
const Colorf& color)
Appends a color step at the specified age.
Steps must be added in ascending age order; an out-of-order step is rejected with a warning.