19 #define DEFAULT_COLLIDE_REST 1
47 #define MINQUAD_AREA 16
QuadTree * botLeftTree
bottom left child
Definition: QuadTree.h:75
QuadTree * topRightTree
Top right child.
Definition: QuadTree.h:73
QuadTree(Point topL, Point botR)
Construct a quadtree of bounds topL and botR.
Definition: QuadTree.cpp:7
bool treeHolder
A bool stating whether this tree is a parent of other nodes.
Definition: QuadTree.h:65
void shrink()
Definition: QuadTree.cpp:179
int nextFreeNode
Definition: QuadTree.h:62
int size
The number of particles in this QuadTree including children.
Definition: QuadTree.h:61
#define QUAD_MAX
The max number of particles that can be in a single quad tree.
Definition: QuadTree.h:44
Node * nodes[QUAD_MAX]
The particles of this Quadtree.
Definition: QuadTree.h:58
bool inBoundary(Point)
Check if current quadtree contains the point.
Definition: QuadTree.cpp:134
Point botRight
Definition: QuadTree.h:55
Point topLeft
Definition: QuadTree.h:54
QuadTree * topLeftTree
Top left child.
Definition: QuadTree.h:71
A class to represent QuadTree.
Definition: QuadTree.h:50
int mid
A unique id for this particle.
Definition: QuadTree.h:40
Node(Point _pos, ParticleGroupHandle *_data, int _id)
Constructor taking in a position group handle and unique id.
Definition: QuadTree.h:34
ParticleGroupHandle * mGroup
The handle and identifier for this particles group.
Definition: QuadTree.h:31
Definition: ParticleGroupHandle.h:29
QuadTree * botRightTree
bottom right child
Definition: QuadTree.h:77
#define DEFAULT_COLLIDE_REST
The defualt number of frames that a particle must be alive before it can collide again...
Definition: QuadTree.h:19
int canCollide
If can collide is > 0 this particle is newly spawned and cannot collide.
Definition: QuadTree.h:28
Point pos
The current position of this particle.
Definition: QuadTree.h:25
void insert(Node *)
Definition: QuadTree.cpp:16
objects stored in quadtree
Definition: QuadTree.h:22
void remove(Node *n)
Definition: QuadTree.cpp:142
Point(int _x, int _y)
constructs a point
Definition: QuadTree.h:12
int y
Definition: QuadTree.h:10
QuadTree * parent
Pointer to parent of this tree.
Definition: QuadTree.h:68
int x
x position
Definition: QuadTree.h:9
where something is in 2d space
Definition: QuadTree.h:7