Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Updated readme
  • Loading branch information
skell999 authored Mar 24, 2022
1 parent 9a2799b commit 6973317
Showing 1 changed file with 24 additions and 26 deletions.
50 changes: 24 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,37 @@
MyAddon (rename to your addon's name)
ofxSpatialHash
=====================================

*This is a template of a README file for your addon. Fill in the relevant sections, and it should already give users a pretty good overview over your awesome addon!*
We chose the [Markdown format](http://daringfireball.net/projects/markdown/syntax) since it can present good formatting where available (e.g. on Github) while still staying human-readable with a plain text editor.
Don't forget, before announcing your addon to the world, you should replace `README.md` with this file and remove `README_AUTHOR.md`.

Introduction
------------
Describe what your addon is about
Fast nearest neighbour lookup for 2d particle systems

License
-------
State which license you offer your addon under. openFrameworks is distributed under the [MIT License](https://en.wikipedia.org/wiki/MIT_License), and you might consider using this for your repository. By default, `license.md` contains a copy of the MIT license to which you can add your name and the year.
[MIT License](https://en.wikipedia.org/wiki/MIT_License)

Installation
------------
Any steps necessary to install your addon. Optimally, this means just dropping the folder into the `openFrameworks/addons/` folder.
Git clone or copy into `openFrameworks/addons/` folder.

Dependencies
Usage
------------
What other addons are needed to properly work with this one?
#### First use
First initialise the hash with the correct dimensions `ofxSpatialHash::init()` <br />
Points can be added to the hash with `ofxSpatialHash::addPoint(float x, float y, T value)` <br />
Search for points `getNearestPoints(float x, float y, float radius)` and test for distance if necessary <br />

Compatibility
------------
Which versions of OF does this addon work with?
#### Update points
Clear hash `ofxSpatialHash::clear()` <br />
Add points `ofxSpatialHash::addPoint(float x, float y, T value)` <br />

Known issues
------------
Any specific (and long-living) issues/limitations you want to mention? For bugs, etc. you should use the issue tracker of your addon's repository

Version history
------------
It make sense to include a version history here (newest releases first), describing new features and changes to the addon. Use [git tags](http://learn.github.com/p/tagging.html) to mark release points in your repo, too!

### Version 0.1 (Date):
Describe relevant changes etc.
#### Example
All points contained in the green squares will be returned from a call to `ofxSpatialHash::getNearestPoints(float x, float y, float radius)`<br />
Users need to test the returned points to see if they are inside the radius with a call to `ofVec2f::distance` or `glm::distaance`

![Example](https://github.com/skell999/ofxSpatialHash/blob/main/docs/example.jpg?raw=true)

Known issues
------------
- 2d only.
- Points must be positive in x and y.
- The spatial hash top left corner is anchored to 0,0.
- The class needs a predefined space width and height. Points outside this space will cause errors.
- The returned points from a nearest neighbour search will contain points outside of the search radius.
- An extra distance check provided by the user is needed to make sure you have points contained inside the radius.

0 comments on commit 6973317

Please sign in to comment.