Revision: | 1.2 |
Committed: | Sun Oct 3 02:38:33 2004 UTC (19 years, 8 months ago) by root |
Content type: | text/plain |
Branch: | MAIN |
Changes since 1.1: | +30 -4 lines |
Log Message: | *** empty log message *** |
# | User | Rev | Content |
---|---|---|---|
1 | root | 1.1 | #include <cstdlib> |
2 | |||
3 | #include "oct.h" | ||
4 | root | 1.2 | #include "entity.h" |
5 | |||
6 | octant world(0); | ||
7 | |||
8 | octant::octant (octant *parent) | ||
9 | : parent(parent) | ||
10 | { | ||
11 | for (fill = 8; fill--; ) | ||
12 | sub[fill] = 0; | ||
13 | |||
14 | extent = parent | ||
15 | ? parent->extent >> 1 | ||
16 | : SOFFS_MAXEXTENT; | ||
17 | } | ||
18 | |||
19 | octant::~octant () | ||
20 | { | ||
21 | for (fill = 8; fill--; ) | ||
22 | delete sub[fill]; | ||
23 | } | ||
24 | |||
25 | void octant::add (entity_base *e) | ||
26 | { | ||
27 | push_back (e); | ||
28 | e->o.push_back (this); | ||
29 | } | ||
30 | root | 1.1 | |
31 | void octant::remove (entity_base *e) | ||
32 | { | ||
33 | } | ||
34 | |||
35 | root | 1.2 | void octant::draw (const draw_context &ctx) |
36 | root | 1.1 | { |
37 | root | 1.2 | for (iterator i = end (); i-- != begin (); ) |
38 | (*i)->draw (ctx); | ||
39 | root | 1.1 | } |
40 | root | 1.2 |