1 |
#ifndef OCT_H |
2 |
#define OCT_H |
3 |
|
4 |
#include <vector> |
5 |
|
6 |
using namespace std; |
7 |
|
8 |
#include "util.h" |
9 |
#include "view.h" |
10 |
|
11 |
struct octant : vector<entity *>, recv_occ_query { |
12 |
struct octant *parent; |
13 |
/* front 23 back 67 |
14 |
* 01 45 */ |
15 |
struct octant *sub[8]; |
16 |
int fill; |
17 |
sector orig; |
18 |
uoffs extent; |
19 |
|
20 |
void add (entity *e); |
21 |
void remove (entity *e); |
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); |
30 |
~octant (); |
31 |
}; |
32 |
|
33 |
extern octant world; |
34 |
|
35 |
#endif |
36 |
|
37 |
|