1 | #ifndef OCT_H |
1 | #ifndef OCT_H |
2 | #define OCT_H |
2 | #define OCT_H |
3 | |
3 | |
|
|
4 | #include <vector> |
|
|
5 | |
4 | using namespace std; |
6 | using namespace std; |
5 | |
7 | |
6 | struct entity_base; |
8 | #include "util.h" |
|
|
9 | #include "view.h" |
7 | |
10 | |
8 | struct octant { |
11 | struct octant : protected vector<entity *>, public recv_occ_query { |
9 | struct octant *parent; |
12 | struct octant *parent; |
10 | /* front 01 back 45 |
13 | /* front 23 back 67 |
11 | * 23 67 */ |
14 | * 01 45 */ |
12 | struct octant *sub[8]; |
15 | struct octant *sub[8]; |
|
|
16 | int fill; |
|
|
17 | sector orig; |
|
|
18 | uoffs extent; |
13 | |
19 | |
14 | void add (entity_base *e); |
20 | void add (entity *e); |
15 | void remove (entity_base *e); |
21 | void remove (entity *e); |
16 | |
22 | |
|
|
23 | void detect_visibility (view &ctx); |
|
|
24 | void display (view &ctx); |
|
|
25 | void draw_bbox (view &ctx); |
|
|
26 | |
|
|
27 | void event (occ_query &ev); |
|
|
28 | |
|
|
29 | octant (octant *parent, const sector &orig, uoffs extent); |
17 | ~octant (); |
30 | ~octant (); |
18 | }; |
31 | }; |
19 | |
32 | |
|
|
33 | extern octant world; |
|
|
34 | |
20 | #endif |
35 | #endif |
|
|
36 | |
|
|
37 | |