Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( Capacity = 8 MaxDepth = 6 )
Functions ¶
This section is empty.
Types ¶
type AABB ¶
type AABB struct {
// contains filtered or unexported fields
}
func (*AABB) ContainsPoint ¶
ContainsPoint checks whether the point provided resides within the axis aligned bounding box.
type Point ¶
type Point struct {
// contains filtered or unexported fields
}
func (*Point) Coordinates ¶
Coordinates return the x and y coordinates of a point.
type QuadTree ¶
type QuadTree struct {
// contains filtered or unexported fields
}
func New ¶
New creates a new *QuadTree. It requires a boundary defining the center and half points, depth at which the QuadTree resides and parent node. Depth of 0 and parent as nil implies the root node.
func (*QuadTree) Insert ¶
Insert will attempt to insert the point into the QuadTree. It will recursively search until it finds the leaf node. If the leaf node is at capacity then it will try split the node. If the tree is at max depth then point will be stored in the leaf.
func (*QuadTree) Remove ¶
Remove attemps to remove a point from the QuadTree. It will recurse until the leaf node is found and then try to remove the point.