diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2011-05-08 15:52:41 +0200 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2011-05-08 15:52:41 +0200 |
commit | 595ac4744b75688f7ca61993c42ea9eedab3a6b7 (patch) | |
tree | 89f7e10b47fb4e709d2896d5e366305ec3a3ced8 /quadtree.h | |
parent | 7d5c1adf8e581599848b3fec54e0af88eb469046 (diff) |
Merged Quadtree and friends into Terrain.
Diffstat (limited to 'quadtree.h')
-rw-r--r-- | quadtree.h | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/quadtree.h b/quadtree.h deleted file mode 100644 index 84125d2..0000000 --- a/quadtree.h +++ /dev/null @@ -1,68 +0,0 @@ -#ifndef QUADTREE_H -#define QUADTREE_H - -#include "vector.h" -#include "terrain.h" - -#include <list> - -class Quadtree { - public: - struct QuadChunk; - - struct QuadNode { - QuadChunk *chunk; - float x, y, width, height; - float vertex_array[15]; - - QuadNode(QuadChunk *chunk, float x, float y, float width, float height); - virtual ~QuadNode(); - - float distance(float px, float pz); - void fill(); - void draw(); - void draw_grid(); - void draw_normal(); - float get_height(float px, float py); - Vector3 get_normal(int index); - }; - - struct QuadChunk { - Quadtree *tree; - QuadNode **nodes; - float x, y, width, height; - float *heights; - Vector3 *normals; - size_t buf_size; - unsigned int vbo_object; - unsigned int node_count; - unsigned int vertices; - float init_time; - - QuadChunk(Quadtree *tree, float x, float y, float width, float height); - ~QuadChunk(); - - float distance(float px, float pz); - void make_vbo(); - QuadNode *find(float x, float y); - void calc_normals(); - }; - - static const int chunk_size = 32; - - std::list<QuadChunk*> chunks; - Terrain *terrain; - Quadtree(); - virtual ~Quadtree(); - - void raise(float x, float z, float radius, float focus, float strength, bool up = true); - - void update(float x, float z); - QuadNode *find(float x, float y); - QuadNode *get_left(QuadNode *node); - QuadNode *get_right(QuadNode *node); - QuadNode *get_up(QuadNode *node); - QuadNode *get_down(QuadNode *node); -}; - -#endif |