breakup walk system and add new exit animation
[carveJwlIkooP6JGAAIwe30JlM.git] / particle.h
1 #ifndef PARTICLE_H
2 #define PARTICLE_H
3
4 #include "skaterift.h"
5
6 typedef struct particle_system particle_system;
7 typedef struct particle particle;
8 typedef struct particle_vert particle_vert;
9
10 struct particle_system {
11 struct particle {
12 v3f co, v;
13 f32 life;
14 u32 colour;
15 }
16 *array;
17
18 #pragma pack(push,1)
19 struct particle_vert {
20 v3f co;
21 u32 colour;
22 }
23 *vertices;
24 #pragma pack(pop)
25
26 u32 alive, max;
27 GLuint vao, vbo, ebo;
28
29 /* render settings */
30 f32 scale, velocity_scale, width;
31 }
32 static particles_grind = {
33 .scale = 0.02f,
34 .velocity_scale = 0.001f,
35 .width = 0.0125f
36 };
37
38 static void particle_alloc( particle_system *sys, u32 max );
39 static void particle_system_update( particle_system *sys, f32 dt );
40 static void particle_system_debug( particle_system *sys );
41 static void particle_system_prerender( particle_system *sys );
42 static void particle_system_render( particle_system *sys, camera *cam );
43
44 static void particle_spawn( particle_system *sys,
45 v3f co, v3f v, f32 lifetime, u32 colour );
46 static void particle_spawn_cone( particle_system *sys,
47 v3f co, v3f dir, f32 angle, f32 speed,
48 f32 lifetime, u32 colour );
49
50 #include "shaders/particle.h"
51
52 #endif /* PARTICLE_H */