#include <Quadtree.h>
Public Member Functions | |
void | SetSize (float minx, float miny, float maxx, float maxy) |
void | Insert (Object *obj) |
void | Remove (Object *obj) |
void | RemoveAll () |
void | InRange (Object *Obj, float range, bool SP=false, uint TypeMask=TYPE_PLAYER, uint TypeValue=1) |
bool | Update (Object *data) |
void QuadTree::InRange | ( | Object * | Obj, | |
float | range, | |||
bool | SP = false , |
|||
uint | TypeMask = TYPE_PLAYER , |
|||
uint | TypeValue = 1 | |||
) | [inline] |
Return a list of all objects found in the given range from the given point matching a specific type.
void QuadTree::Insert | ( | Object * | obj | ) |
Insert a object into the quad tree.
void QuadTree::Remove | ( | Object * | obj | ) |
Remove the object from the quad tree.
void QuadTree::RemoveAll | ( | ) |
Remove all objects from the quad tree
void QuadTree::SetSize | ( | float | minx, | |
float | miny, | |||
float | maxx, | |||
float | maxy | |||
) |
Clear all the objects from the quadtree and set it to have given size.
bool QuadTree::Update | ( | Object * | data | ) | [inline] |
Update object's position in the quad tree. Must be called after every time object changes position. It is cheap to call if the object haven't moved to a different node, so you should'nt make any unneccessary optimizations to call Update less often if the object position has't changed.