SpatialTree

Implementation of QuadTree and OcTree, with loose bounds and without Loose octree requires from type T to have member pos and radius, it can be function or variable.

Members

Aliases

Point
alias Point = float[dimension]
Undocumented in source.
QuadContainer
alias QuadContainer = BucketsListChain!(Node[2^^Point.length], 128, false)
Undocumented in source.
isLoose
alias isLoose = loose
Undocumented in source.

Functions

add
void add(Point pos, T data)
Undocumented in source. Be warned that the author may not have intended to support it.
addToQuad
void addToQuad(Point pos, T data, Node* quad, float halfSize, ubyte level)
Undocumented in source. Be warned that the author may not have intended to support it.
allocateQuads
void allocateQuads(Node* quad, int level)

////////////////////// / Helper functions /// //////////////////////

clear
void clear()
Undocumented in source. Be warned that the author may not have intended to support it.
initialize
void initialize()
Undocumented in source. Be warned that the author may not have intended to support it.
remove
void remove(Point posRemove, T data)

////////////////////// // Add functions ///// //////////////////////

updatePositions
void updatePositions()
Undocumented in source. Be warned that the author may not have intended to support it.
visitAll
int visitAll(int delegate(Point pos, Node* quad, float halfSize, int level) visitor)

////////////////////// / Visit functions //// //////////////////////

visitAll
int visitAll(int delegate(Point pos, Node* quad, float halfSize, int level) visitor, Point pos, Node* quad, float halfSize, int level)
Undocumented in source. Be warned that the author may not have intended to support it.
visitAllDataIn
void visitAllDataIn(void delegate(ref T data) visitor, Point downLeft, Point upRight)
Undocumented in source. Be warned that the author may not have intended to support it.
visitAllNodesIn
void visitAllNodesIn(int delegate(Point pos, Node* quad, float halfSize, int level) visitor, Point downLeft, Point upRight)
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

circleInBox
bool circleInBox(Point left, Point right, Point pos, float radius)
Undocumented in source. Be warned that the author may not have intended to support it.
circleNotInBox
bool circleNotInBox(Point left, Point right, Point pos, float radius)
Undocumented in source. Be warned that the author may not have intended to support it.
directionToIndex
uint directionToIndex(bool[Point.length] dir)
Undocumented in source. Be warned that the author may not have intended to support it.
hasChildren
bool hasChildren(Node* node, int level)
Undocumented in source. Be warned that the author may not have intended to support it.
hasElements
bool hasElements(int level)
Undocumented in source. Be warned that the author may not have intended to support it.
inBox
bool inBox(Point left, Point right, Point myLeft, Point myRight)
Undocumented in source. Be warned that the author may not have intended to support it.
indexToDirection
bool[Point.length] indexToDirection(uint index)
Undocumented in source. Be warned that the author may not have intended to support it.
notInBox
bool notInBox(Point left, Point right, Point myLeft, Point myRight)
Undocumented in source. Be warned that the author may not have intended to support it.

Structs

Node
struct Node
Undocumented in source.

Variables

quadContainer
QuadContainer quadContainer;
Undocumented in source.
root
Node root;
Undocumented in source.
size
float size;
Undocumented in source.

Meta