Auios.QuadTree 1.1.1

.NET Core 3.1
Install-Package Auios.QuadTree -Version 1.1.1
dotnet add package Auios.QuadTree --version 1.1.1
<PackageReference Include="Auios.QuadTree" Version="1.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Auios.QuadTree --version 1.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Auios.QuadTree, 1.1.1"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Auios.QuadTree as a Cake Addin
#addin nuget:?package=Auios.QuadTree&version=1.1.1

// Install Auios.QuadTree as a Cake Tool
#tool nuget:?package=Auios.QuadTree&version=1.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.



A Generic QuadTree algorithm inspired by Leonidovia's Ultimate QuadTree.



Install-Package Auios.QuadTree


// Implement IQuadTreeObjectBounds<T> interface for the object type to be stored
public class MyCustomBounds : IQuadTreeObjectBounds<Vector2>
    public float GetBottom(Vector2 obj) => obj.Y;
    public float GetTop(Vector2 obj) => obj.Y;
    public float GetLeft(Vector2 obj) => obj.X;
    public float GetRight(Vector2 obj) => obj.X;

// Create a QuadTree and fill it with objects
QuadTree<Vector2> quadTree = new QuadTree<Vector2>(800, 600, new MyCustomBounds());

// Generate some data to insert
Random random = new Random();
List<Vector2> myPositions = new List<Vector2>();
for(int i = 0; i < 1000; i++)
    myPositions.Add(new Vector2((float)800 * random.NextDouble(), (float)600 * random.NextDouble()));

 // Insert data into the QuadTree
foreach(Vector2 position in myPositions)

// Define search area (x, y, width, height)
QuadTreeRect searchArea = new QuadTreeRect(150, 100, 50, 25);

// Find objects in leaf quadrants which overlap the search area
Vector2[] positions = quadTree.FindObjects(searchArea);





Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
.NET Core netcoreapp3.1
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.1 406 10/31/2020
1.1.0 211 10/31/2020
1.0.2 192 10/31/2020
1.0.1 219 10/31/2020
1.0.0 229 10/31/2020

* Using Auios.Rectangle
* Can insert collections of objects now
* Made the Area field public
* Constructors get along with Vector2 now
* Small Insertion optimization

* Updated logo