Skip to content

Commit 55f6736

Browse files
committed
update readme
1 parent 15cc7fa commit 55f6736

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

README.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
![NativeTrees](./Packages/NativeTrees/NativeTrees.png "NativeTrees")
22

3-
Generic sparse octree and quadtree
3+
Generic sparse octree and quadtree
44
that store objects together with their axis aligned bounding boxes (AABB's)
55

66
Written in C# for Unity's burst compiler and the ECS/DOTS framework.
@@ -21,10 +21,10 @@ Tested with Unity 2021.1.3.11f1
2121
### Limitations:
2222
- Objects must be structs (Burst limitation)
2323
- No remove or update. Tried several approaches but they either left an unbalanced tree or doing a
24-
full clear and re-insert was faster.
24+
full clear and re-insert was faster.
2525
- No foreach support, we leverage the stack and "struct" delegates, which suits the recursive
26-
nature of the tree better.
27-
26+
nature of the tree better.
27+
2828
- Insertion can only be done on a single thread. Queries ofcourse can be across multiple threads.
2929

3030
### Future todo's:
@@ -33,24 +33,24 @@ nature of the tree better.
3333

3434
## Installation
3535

36-
Using the Unity package manager, choose Add Package from git URL and enter:
36+
Using the Unity package manager, choose Addd Package from git URL and enter:
3737

3838
https://github.com/bartofzo/NativeTrees.git?path=/Packages/NativeTrees
3939

4040
## Performance
4141

42-
The trees are heaviliy optimized to make use of SIMD instructions.
42+
The trees are heaviliy optimized to make use of SIMD instructions.
4343
Therefore performance is best when used in burst compiled code.
4444

45-
Queries are *very* fast.
45+
Queries are *very* fast.
4646
The raycast never visits more nodes than absolutely neccessary.
4747
The overlap (and insertion) use a technique where to test in which child nodes AABB's should go, only
4848
two comparisons are made followed up by some bitwise operations. (See the source for an explanation).
4949

5050
Nearest neighbour is the slowest of the bunch (but still fast) as it has some overhead in keeping track of a priority queue.
5151

5252
Actual performance can vary wildly depending on the structure of your tree and it's
53-
settings. For the sake of cool stats, here are some numbers on insertion times and raycasts for random points and AABB's,
53+
settings. For the sake of cool stats, here are some numbers on insertion times and raycasts for random points and AABB's,
5454
Single thread burst compiled, maxDepth of 8. These numbers should not be taken too seriously because it's random data
5555
and the tree will be divided almost equally everywhere, which in most realistic scenarios is not the case.
5656

@@ -74,6 +74,10 @@ There are two samples included that show how to use the octree and quadtree.
7474
The extension classes provide readymade solutions for AABB only checking. For more complicated
7575
shapes you must provide your own ray/overlap/distance calculations.
7676

77+
NOTE: If you've imported the package via the Unity Package Manager, you need to copy the
78+
sample scenes to your Assets folder to open them.
79+
[See this thread](https://forum.unity.com/threads/it-is-not-allowed-to-open-a-scene-in-a-read-only-package-why.1148036/)
80+
7781
### Insertion
7882
The objects can be of any unmanaged type, when inserting, an AABB must be provided:
7983

@@ -92,7 +96,6 @@ If you know your objects are points, you can insert them faster by using:
9296
// Insert entities that are 'points'
9397
for (int i = 0; i < entities.Length; i++)
9498
{
95-
var entity = entities[i];
9699
octree.InsertPoint(entities[i], positions[i]);
97100
}
98101

@@ -197,10 +200,11 @@ A hashset can be used to only visit each object once.
197200

198201
### Support
199202
Feel free to raise an issue or contact me for any questions.
200-
The code is free to use in your project(s).
203+
The code is free to use in your project(s).
201204
If this was helpful to you, consider buying me a coffee ;)
202205

203-
https://ko-fi.com/bartofzo
206+
<a href='https://ko-fi.com/bartofzo' target='_blank'><img height='35' style='border:0px;height:46px;' src='https://az743702.vo.msecnd.net/cdn/kofi3.png?v=0' border='0' alt='Buy Me a Coffee at ko-fi.com' />
207+
204208

205209
Thank you!
206210

@@ -216,4 +220,4 @@ Nearest neighbour search:
216220
https://stackoverflow.com/a/41306992
217221

218222
AnyPath, my pathfinding library on the Unity Asset store:
219-
https://assetstore.unity.com/packages/tools/ai/anypath-213200
223+
https://assetstore.unity.com/packages/tools/ai/anypath-213200

0 commit comments

Comments
 (0)