5 Struct PARTICLE_EMITTER
gullradriel edited this page 2026-10-09 00:55:18 +02:00

PARTICLE_EMITTER

Module: GRAPHICS: 3D particles utilities

Structure of a particle emitter.

#include "n_particles.h"

Public Attributes

Name
VECTOR3D velocity_min
random velocity range min
VECTOR3D velocity_max
random velocity range max
int spr_id
sprite id or -1
int size_start
particle size at birth
int size_end
particle size at death
double shape_w
shape dimension 1: line length, rect width, or circle radius (world units)
double shape_rotation
shape rotation in radians
double shape_h
shape dimension 2: rect height (world units)
int shape
emission shape: 0=point, 1=line, 2=rect, 3=circle
VECTOR3D position
emitter world position
int particle_mode
particle draw mode (NORMAL_PART, CIRCLE_PART, PIXEL_PART, FIRE_PART, etc.)
VECTOR3D offset
offset when attached to entity
int max_particles
per-emitter particle cap (0=unlimited)
int live_count
current live particle count for this emitter (managed by system)
int lifetime_min
particle lifetime range min (msecs)
int lifetime_max
particle lifetime range max (msecs)
double emit_rate
particles per second (continuous mode)
double emit_accumulator
internal: fractional particle accumulator
int depth_sort
1=depth-sorted with terrain, 0=flat overlay
ALLEGRO_COLOR color_start
particle start color
ALLEGRO_COLOR color_end
particle end color (lerp over lifetime)
int burst_count
if >0, emit this many instantly then deactivate
int attached_entity_id
-1=not attached, >=0=entity id
int additive_blend
1=additive blend, 0=normal alpha blend
int active
1=emitting, 0=paused
VECTOR3D acceleration
constant acceleration (gravity etc.)

Public Attributes Documentation

variable velocity_min

VECTOR3D velocity_min;

random velocity range min

variable velocity_max

VECTOR3D velocity_max;

random velocity range max

variable spr_id

int spr_id;

sprite id or -1

variable size_start

int size_start;

particle size at birth

variable size_end

int size_end;

particle size at death

variable shape_w

double shape_w;

shape dimension 1: line length, rect width, or circle radius (world units)

variable shape_rotation

double shape_rotation;

shape rotation in radians

variable shape_h

double shape_h;

shape dimension 2: rect height (world units)

variable shape

int shape;

emission shape: 0=point, 1=line, 2=rect, 3=circle

variable position

VECTOR3D position;

emitter world position

variable particle_mode

int particle_mode;

particle draw mode (NORMAL_PART, CIRCLE_PART, PIXEL_PART, FIRE_PART, etc.)

variable offset

VECTOR3D offset;

offset when attached to entity

variable max_particles

int max_particles;

per-emitter particle cap (0=unlimited)

variable live_count

int live_count;

current live particle count for this emitter (managed by system)

variable lifetime_min

int lifetime_min;

particle lifetime range min (msecs)

variable lifetime_max

int lifetime_max;

particle lifetime range max (msecs)

variable emit_rate

double emit_rate;

particles per second (continuous mode)

variable emit_accumulator

double emit_accumulator;

internal: fractional particle accumulator

variable depth_sort

int depth_sort;

1=depth-sorted with terrain, 0=flat overlay

variable color_start

ALLEGRO_COLOR color_start;

particle start color

variable color_end

ALLEGRO_COLOR color_end;

particle end color (lerp over lifetime)

variable burst_count

int burst_count;

if >0, emit this many instantly then deactivate

variable attached_entity_id

int attached_entity_id;

-1=not attached, >=0=entity id

variable additive_blend

int additive_blend;

1=additive blend, 0=normal alpha blend

variable active

int active;

1=emitting, 0=paused

variable acceleration

VECTOR3D acceleration;

constant acceleration (gravity etc.)