-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathquadtreenode.h
More file actions
45 lines (36 loc) · 944 Bytes
/
quadtreenode.h
File metadata and controls
45 lines (36 loc) · 944 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef QUADTREENODE_H
#define QUADTREENODE_H
#include "core/object/ref_counted.h"
#include "core/math/rect2.h"
#include "core/math/vector2.h"
class QuadTreeNode: public RefCounted
{
GDCLASS(QuadTreeNode, RefCounted);
private:
protected:
static void _bind_methods();
public:
Rect2i bounds;
int state;
QuadTreeNode* parent;
Ref<QuadTreeNode> child_nw;
Ref<QuadTreeNode> child_ne;
Ref<QuadTreeNode> child_sw;
Ref<QuadTreeNode> child_se;
Ref<QuadTreeNode> get_nw();
Ref<QuadTreeNode> get_ne();
Ref<QuadTreeNode> get_sw();
Ref<QuadTreeNode> get_se();
void split();
void close(const int state);
void insert_rect(const Rect2& target, const int value);
int state_at_point(const Vector2& point);
int get_state();
Rect2 get_bounds();
void set_state(const int state);
void set_bounds(const Rect2& bounds);
void init_node(const Rect2& bounds, const int state);
QuadTreeNode();
~QuadTreeNode();
};
#endif // QUADTREENODE_H