A struct that represents the configurations of a particle emitter. More...
#include <particles.h>
Public Attributes | |
| Vec2 | position |
| Position of the emitter. | |
| float | emissionRate |
| Time between emissions in seconds. | |
| int | emissionNumber |
| Number of particles to emit per emission. | |
| int | maxParticles |
| Maximum particles this emitter can have. | |
| Vec2 | direction |
| Base direction of emission. | |
| float | angleRange |
| Spread angle in degrees (0 - 360). | |
| bool | active |
| Whether the current emitter is active. | |
| float | emitterLifetime |
| How long the emitter is active in seconds. | |
| float | emitterAge |
| How long the emitter has been active in seconds. | |
| int | loopCount |
| Number of times to loop. | |
| bool | destroyWhenDone |
| Destroys emitter when all particles are gone. | |
| bool | cameraLocked |
| If true, particles will appear static on the screen. | |
| float | particleLifetime |
| How long particles live in seconds. | |
| float | particleSpeed |
| Particle movement speed. | |
| void(* | custom_Movement )(Particle *) |
| Movement behavior function (Will override default movement) | |
| SDL_Color | startColor |
| Initial particle color. | |
| SDL_Color | endColor |
| Final particle color. | |
| Vec2 | startSize |
| Initial size of particles in pixels. | |
| Vec2 | endSize |
| Final size of particles in pixels. | |
| SDL_Texture * | particleTexture |
| Optional texture (NULL = rectangle) | |
| Vec2 | gravity |
| Force applied over time. | |
| float | drag |
| Air resistance factor. | |
| Timer * | emissionTimer |
| Timer for emission control. | |
| Particle * | particles |
| Array of particles. | |
| int | readyIndex |
| Next available particle index. | |
| struct ParticleEmitter ** | selfReference |
| A double pointer to this emitter. | |
| bool | useCollider |
| Whether to use a collider for the emitter. | |
| Collider | collider |
| Collider for the emitter (Not implemented) | |
A struct that represents the configurations of a particle emitter.
Emitter is responsible for creating and managing particles. Emitter presets (such as fire, smoke, gunshots, etc.) can be created and reused inside particle_emitterpresets.h and .c Emitters themselves can be created with ParticleEmitter_CreateDefault() and then modified as needed.
| bool ParticleEmitter::active |
Whether the current emitter is active.
| float ParticleEmitter::angleRange |
Spread angle in degrees (0 - 360).
Spread is applied to direction.
| bool ParticleEmitter::cameraLocked |
If true, particles will appear static on the screen.
| void(* ParticleEmitter::custom_Movement) (Particle *) |
Movement behavior function (Will override default movement)
| bool ParticleEmitter::destroyWhenDone |
Destroys emitter when all particles are gone.
Suitable for one-time effects.
| Vec2 ParticleEmitter::direction |
Base direction of emission.
Direction is randomized by angleRange
| float ParticleEmitter::drag |
Air resistance factor.
| int ParticleEmitter::emissionNumber |
Number of particles to emit per emission.
| float ParticleEmitter::emissionRate |
Time between emissions in seconds.
| float ParticleEmitter::emitterAge |
How long the emitter has been active in seconds.
| float ParticleEmitter::emitterLifetime |
How long the emitter is active in seconds.
| SDL_Color ParticleEmitter::endColor |
Final particle color.
| Vec2 ParticleEmitter::endSize |
Final size of particles in pixels.
| Vec2 ParticleEmitter::gravity |
Force applied over time.
| int ParticleEmitter::loopCount |
Number of times to loop.
-1 for Infinite. 1 for once. 0 for none
| int ParticleEmitter::maxParticles |
Maximum particles this emitter can have.
| float ParticleEmitter::particleLifetime |
How long particles live in seconds.
| Particle* ParticleEmitter::particles |
Array of particles.
| float ParticleEmitter::particleSpeed |
Particle movement speed.
| SDL_Texture* ParticleEmitter::particleTexture |
Optional texture (NULL = rectangle)
| Vec2 ParticleEmitter::position |
Position of the emitter.
| int ParticleEmitter::readyIndex |
Next available particle index.
| struct ParticleEmitter** ParticleEmitter::selfReference |
A double pointer to this emitter.
Used to set the reference to NULL when destroyed.
| SDL_Color ParticleEmitter::startColor |
Initial particle color.
| Vec2 ParticleEmitter::startSize |
Initial size of particles in pixels.
| bool ParticleEmitter::useCollider |
Whether to use a collider for the emitter.