summaryrefslogtreecommitdiff
path: root/quadtree.h
diff options
context:
space:
mode:
Diffstat (limited to 'quadtree.h')
-rw-r--r--quadtree.h66
1 files changed, 0 insertions, 66 deletions
diff --git a/quadtree.h b/quadtree.h
deleted file mode 100644
index 45ee09b..0000000
--- a/quadtree.h
+++ /dev/null
@@ -1,66 +0,0 @@
-#ifndef QUADTREE_H
-#define QUADTREE_H
-
-#include "vector.h"
-
-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();
- float get_height(float px, float py);
- Vector3 get_normal(int index);
- };
-
- struct QuadChunk {
- Quadtree *tree;
- QuadChunk *children[4];
- QuadNode **nodes;
- float x, y, width, height;
- 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);
- };
-
- static const int chunk_size = 32;
-
- QuadChunk *root;
- float *heights;
- Vector3 *normals;
- int width, height;
- float init_time;
- Quadtree(int width, int height, float *heightmap);
- virtual ~Quadtree();
-
- void raise(float x, float z, float radius, float focus, float strength);
-
- Vector3 calc_normal(int x, int y);
- 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