3 Copyright (C) 2003 Nuno Subtil
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 /* $Id: particle.h,v 1.2 2003/11/22 17:32:10 nsubtil Exp $ */
25 #define PARTICLE_STATE_DEAD 0
26 #define PARTICLE_STATE_ACTIVE 1
30 /* particle state (dead, active, ...) */
34 /* 3D world-space position */
36 /* constant direction vector */
48 /* number of particle structures */
51 struct particle
*particles
;
53 /* life of each particle */
55 /* fade time of each particle */
57 /* particle generation rate */
59 /* last generation time */
60 float last_particle_time
;
64 /* fountain position */
66 /* fountain speed vector */
68 /* fountain direction */
70 /* maximum direction spread */
74 /* maximum speed variation */
76 /* fountain gravity */
81 /* light source for particle */
82 struct light
*light_src
;
85 struct particle_src
*particle_new_src(float life
, float fade
, float rate
, float size
,
86 float position
[3], float direction
[3], float src_speed
[3],
87 float spread
, float speed
, float speed_spread
,
88 float gravity
, float color
[4]);
89 int particle_add(struct particle_src
*src
);
90 void particle_src_update(struct game
*game
, struct particle_src
*src
, float delta
);
91 void particle_update(struct game
*game
, struct particle_src
*src
, int particle_no
, float delta
);
92 void particle_free_src(struct particle_src
*src
);
93 int particle_src_all_dead(struct particle_src
*src
);
94 void particle_src_explode(struct particle_src
*src
, int num_particles_explosion
, float max_speed
);