ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libgender/oct.h
Revision: 1.22
Committed: Wed Jan 25 22:48:02 2006 UTC (18 years, 3 months ago) by root
Content type: text/plain
Branch: MAIN
CVS Tags: HEAD
Changes since 1.21: +7 -1 lines
Log Message:
*** empty log message ***

File Contents

# Content
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 *>, visible
12 {
13 struct octant *parent;
14 /* front 23 back 67
15 * 01 45 */
16 struct octant *sub[8];
17 int fill;
18 sector orig; // center
19 uoffs extent; // half the edge size, "radius"
20
21 void add (entity *e);
22 void remove (entity *e);
23
24 enum {
25 VIS_FULL,
26 VIS_NONE,
27 VIS_OCCLUDED,
28 };
29
30 int detect_visibility (view &ctx); // is this octant actually visible?
31
32 void draw_depth (view &ctx);
33 void draw_postdepth (view &ctx);
34 void draw_lighted (view &ctx);
35
36 visibility_base *new_visibility ();
37 void clear_visibility (visibility_base *vs);
38
39 octant (octant *parent, const sector &orig, uoffs extent);
40 ~octant ();
41 };
42
43 extern octant world;
44
45 #endif
46
47