Implementation of quadtree data structure in a 2D top-down environment with Unity engine. Please see this page to get detailed information about quadtree.
public void Construct(Vector3[] positions);
- Adds the given array of positions to the quadtree and automatically handles position capacity per quadrant and subdivision.
public void InsertPosition(Vector3 position);
- Adds the given position to the quadtree, considers the position capacity allowed for each quadrant, and subdivides the root quadrant if it is required.
public IReadOnlyList<Vector3> GetPositionsNearby(Vector3 origin);
- Returns a read-only list of Vector3's that are nearby the given origin position.