--- libgender/oct.h 2004/10/02 15:54:43 1.1 +++ libgender/oct.h 2004/10/09 16:36:31 1.12 @@ -1,20 +1,37 @@ #ifndef OCT_H #define OCT_H +#include + using namespace std; -struct entity_base; +#include "util.h" +#include "view.h" -struct octant { +struct octant : protected vector, public recv_occ_query { struct octant *parent; - /* front 01 back 45 - * 23 67 */ + /* front 23 back 67 + * 01 45 */ struct octant *sub[8]; + int fill; + sector orig; + uoffs extent; + + void add (entity *e); + void remove (entity *e); + + void detect_visibility (view &ctx); + void display (view &ctx); + void draw_bbox (view &ctx); - void add (entity_base *e); - void remove (entity_base *e); + void event (occ_query &ev); + octant (octant *parent, const sector &orig, uoffs extent); ~octant (); }; +extern octant world; + #endif + +