summaryrefslogtreecommitdiff
path: root/quadtree.h
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2011-04-01 15:53:14 +0200
committerJon Bergli Heier <snakebite@jvnv.net>2011-04-01 15:53:14 +0200
commit3b360c21777aad02394a643b32be2ab25362bba1 (patch)
treee5a3ed2c546e31c9e83170c53fc75c0016169384 /quadtree.h
parentbd22509aa429c6f33075293e379f1e2b2714a094 (diff)
Some cleanup in preparation for dynamic subdivision of the terrain quadtree.
Diffstat (limited to 'quadtree.h')
-rw-r--r--quadtree.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/quadtree.h b/quadtree.h
index 9a84e98..923a49f 100644
--- a/quadtree.h
+++ b/quadtree.h
@@ -15,7 +15,9 @@ class Quadtree {
QuadNode(Quadtree *tree, QuadNode *parent, float x, float y, float width, float height, int level, bool leaf);
virtual ~QuadNode();
+ void fill();
void subdivide(bool leaf = true);
+ void merge();
void draw();
void draw_grid();
float get_height(float px, float py);
@@ -31,9 +33,10 @@ class Quadtree {
Quadtree(int width, int height, float *heightmap, int levels);
virtual ~Quadtree();
+ void create_nodes(int levels);
unsigned int count_nodes();
void make_vbo();
- QuadNode *find(float x, float y);
+ QuadNode *find(float x, float y, int leve = -1l);
};
#endif