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; |
|
|
7 | |
|
|
8 | #include "util.h" |
5 | |
9 | |
6 | struct entity_base; |
10 | struct entity_base; |
7 | |
11 | |
8 | struct octant { |
12 | struct octant : protected vector<entity_base *> { |
9 | struct octant *parent; |
13 | struct octant *parent; |
10 | /* front 01 back 45 |
14 | /* front 01 back 45 |
11 | * 23 67 */ |
15 | * 23 67 */ |
12 | struct octant *sub[8]; |
16 | struct octant *sub[8]; |
|
|
17 | int fill; |
|
|
18 | sector base; |
|
|
19 | soffs extent; |
13 | |
20 | |
14 | void add (entity_base *e); |
21 | void add (entity_base *e); |
15 | void remove (entity_base *e); |
22 | void remove (entity_base *e); |
16 | |
23 | |
|
|
24 | void draw (const draw_context &ctx); |
|
|
25 | |
|
|
26 | octant (octant *parent); |
17 | ~octant (); |
27 | ~octant (); |
18 | }; |
28 | }; |
19 | |
29 | |
|
|
30 | extern octant world; |
|
|
31 | |
20 | #endif |
32 | #endif |
|
|
33 | |
|
|
34 | |