Closed NickyWeber closed 1 year ago
Hi, just commenting on your illustration: the coordinates 0,0 is in the top left corner. For Rectangles: the geometry starts top left too.
Does that solve it? Otherwise I can test your example code later today.
By the way, to which example do you refer?
In my visualization bottom left is 0,0. I guess it doesn't matter if it's a right hand or left hand coordinate system.
I am referring to the paragraph "Use" in your Readme. It is not stating an outcome, but I am trying to figure out what I should expect and how to use/configure your Quadtree.
I guess it doesn't matter if it's a right hand or left hand coordinate system.
true!
It's expected to recieve all elements in this example, because the Quadtree did not split once yet. The option "maxObjects" defaults to 10, so 10 objects will be in the very first node before the "resolution" increases.
Try to add 11 objects and see if it makes sense then.
The simple example has maxObjects of 4, check it out (see how it splits only when that number is reached. Before, all elements will always be returned from retrieve): https://timohausmann.github.io/quadtree-ts/examples/simple/
If your issue persists feel free to re-open this issue.
Thanks for replying, that make sense.
So if you query the tree and it returns objects the user still has to test if these objects are actually intersected by the retrieve object?
Correct! The Quadtree gives you all objects from intersecting Quadtree-nodes. This reduces the list of potential collisions. But the precise intersections on object-level has to be checked again.
Hey there,
I have some trouble understanding the example given in the documentation. Let's iterate:
Output:
I have plotted the elements in a simple way to visualize what is happening in my understanding:
The purple area is the query
area
. I would have guessed only the redrectangle
returned butretrieve
returns all elements stored.However, when I change the tree's
maxObjects
to 1 it works fine.Am I using the tree in a wrong way?
Thanks in advance