From 3b360c21777aad02394a643b32be2ab25362bba1 Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Fri, 1 Apr 2011 15:53:14 +0200 Subject: Some cleanup in preparation for dynamic subdivision of the terrain quadtree. --- quadtree.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'quadtree.h') 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 -- cgit v1.2.3