Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Nycto/QuadtreeNim
A Quadtree library for Nim
https://github.com/Nycto/QuadtreeNim
Last synced: 3 months ago
JSON representation
A Quadtree library for Nim
- Host: GitHub
- URL: https://github.com/Nycto/QuadtreeNim
- Owner: Nycto
- License: mit
- Created: 2015-08-18T03:36:30.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2019-03-27T16:25:05.000Z (over 5 years ago)
- Last Synced: 2024-05-18T15:32:55.591Z (6 months ago)
- Language: Nim
- Size: 45.9 KB
- Stars: 8
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-nim - quadtree - A Quadtree library for Nim. (Data / Data Structures)
README
QuadtreeNim [![Build Status](https://travis-ci.org/Nycto/QuadtreeNim.svg?branch=master)](https://travis-ci.org/Nycto/QuadtreeNim)
===========A Quadtree library in Nim. Quadtrees are a way of indexing objects on a grid.
You can find a reasonable introduction here:http://gamedevelopment.tutsplus.com/tutorials/make-your-game-pop-with-particle-effects-and-quadtrees--gamedev-2138
API Docs
--------http://nycto.github.io/QuadtreeNim/quadtree.html
A Small Example
---------------```nimrod
import quadtreetype Box = tuple[x, y, width, height: int]
## This represents whatever type you want to store in the treevar tree = newQuadtree[Box]()
tree.insert( (x: 1, y: 1, width: 5, height: 4) )
tree.insert( (x: 2, y: 3, width: 5, height: 5) )
tree.insert( (x: 19, y: 4, width: 3, height: 1) )# Grab all the elements that are near (2, 2)
echo tree.fetch(2, 2)
```License
-------This library is released under the MIT License, which is pretty spiffy. You
should have received a copy of the MIT License along with this program. If
not, see http://www.opensource.org/licenses/mit-license.php