BSP construction debugging
[dosdemo] / src / bsptree.h
1 #ifndef BSPMESH_H_
2 #define BSPMESH_H_
3
4 #include "mesh.h"
5 #include "vmath.h"
6 #include "polyclip.h"
7
8 struct bspnode {
9         struct cplane plane;
10         int vcount;
11         struct g3d_vertex *verts;
12         struct bspnode *front, *back;
13 };
14
15 struct bsptree {
16         struct bspnode *root;
17 };
18
19 int init_bsp(struct bsptree *bsp);
20 void destroy_bsp(struct bsptree *bsp);
21
22 int save_bsp(struct bsptree *bsp, const char *fname);
23 int load_bsp(struct bsptree *bsp, const char *fname);
24
25 int bsp_add_poly(struct bsptree *bsp, struct g3d_vertex *v, int vnum);
26 int bsp_add_mesh(struct bsptree *bsp, struct g3d_mesh *m);
27
28 void draw_bsp(struct bsptree *bsp, float view_x, float view_y, float view_z);
29
30 #endif  /* BSPMESH_H_ */