quadtree 0.4.0

A generic quadtree implementation
Documentation

Quadtree

Current Crates.io Version Documentation

This Quadtree library provides efficient spatial querying capabilities for 2D points. It supports various operations such as insertion, and rectangular and circular querying, making it suitable for applications in areas such as gaming, geographical information systems, and real-time simulations.

Features

  • Generic Implementation: Quadtree<T> works with any data type T that implements the Point and Clone traits.
  • Spatial Queries: Supports querying within spatial regions that implement the Shape trait (Rect and Circle are provided).
  • Dynamic Operations: Efficiently perform mutating operations without full rebuilds.
    • insert
    • insert_many
    • delete
    • pop
  • Barnes-Hut Approximation: The BHQuadtree is provided for Barnes-Hut approximation of n-body simulations. An interactive explanation of this algorithm can be found here. This implementation is heavily inspired by DeadlockCode's Barnes-Hut implementation.
  • Serde Serialization: Enable the "serde" feature to serialize the Quadtree and provided shapes. A Quadtree<T> will serialize into a sequence of items of type T.