make glider look nice
[carveJwlIkooP6JGAAIwe30JlM.git] / trail.h
1 #ifndef TRAIL_H
2 #define TRAIL_H
3
4 #include "skaterift.h"
5
6 typedef struct trail_system trail_system;
7 typedef struct trail_point trail_point;
8 typedef struct trail_vert trail_vert;
9
10 struct trail_system {
11 struct trail_point {
12 v3f co, normal, right;
13 f32 alpha;
14 }
15 *array;
16
17 #pragma pack(push,1)
18 struct trail_vert {
19 v4f co; /* xyz: position, w: alpha */
20 }
21 *vertices;
22 #pragma pack(pop)
23
24 i32 head, count, max;
25 GLuint vao, vbo;
26
27 /* render settings */
28 f32 width, lifetime, min_dist;
29 };
30
31 static void trail_alloc( trail_system *sys, u32 max );
32 static void trail_system_update( trail_system *sys, f32 dt,
33 v3f co, v3f normal, f32 alpha );
34 static void trail_system_debug( trail_system *sys );
35 static void trail_system_prerender( trail_system *sys );
36 static void trail_system_render( trail_system *sys, camera *cam );
37
38 #endif /* TRAIL_H */