5#ifndef __QUADTREENODE_H__
6#define __QUADTREENODE_H__
13const int QUADTREE_THRESH_DEFAULT = 1;
14const int QUADTREE_MAX_DEPTH = 10;
85 void print(std::string label=
"")
const;
Definition: ObjectList.h:15
Definition: QuadtreeNode.h:16
QuadtreeNode * findOwner(Object *p_o, Box b)
Return node in hierarchy where Object should be placed if has new bounding box.
ObjectList m_objects
Objects contained in this node.
Definition: QuadtreeNode.h:22
ObjectList getCollisions(Object *p_o, Vector where) const
Return all Objects that collide at given location.
bool m_split
True if already split children.
Definition: QuadtreeNode.h:23
QuadtreeNode * findOwner(Object *p_o)
Return node in hierarchy where Object should be placed.
ObjectList getObjects() const
Return list of Objects at this node.
QuadtreeNode(QuadtreeNode *p_parent, int depth, Box boundary)
Construct new node with given parent, depth and boundary.
int insertObject(Object *p_o)
Insert Object at this node and split if count > threshold.
QuadtreeNode * findOwner(Object *p_o, Vector where)
Return node in hierarchy where Object should be placed if moved to 'where'.
int getDepth() const
Get depth.
QuadtreeNode * m_p_child[4]
Child nodes (NULL when none).
Definition: QuadtreeNode.h:24
Box getBoundary() const
Get boundary.
~QuadtreeNode()
Destructor, free up child nodes.
int split()
Split this node if it hasn't already.
int removeObject(Object *p_o)
Remove Object from this node.
Box m_boundary
Bounding box of this node.
Definition: QuadtreeNode.h:20
std::string toString() const
Return current node as string.
int m_depth
Depth of this node.
Definition: QuadtreeNode.h:19
QuadtreeNode * m_p_parent
Parent node (NULL if root).
Definition: QuadtreeNode.h:21
An animation for a sprite.
Definition: Animation.h:15