-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
retrieval of object out side the node #6
Comments
I think this manifests in the examples given. In the simple and dynamic examples, nodes that are far away from the cursor and corresponding quadtree bucket are highlighted. Why? They appear to be close to an x-y axis. |
Okay, I see what's going on. The GetIndex checks if the object is completely in the node. If it's not, the parent node is assumed. The objects that are along boundaries of the main four nodes just below the root, will always be considered to be close to all other objects. |
Hey, thanks for bringing this up again. Like @robblovell wrote, this behaviour stems from the tutorials design decision to store objects that don't fully fit into one quadrant on the parent node. However, some years passed and I get how this just seems suboptimal. So I tried the other approach: only store objects on leaf nodes (lowest level). Now if an object overlaps multiple leaf nodes, it will simply be referenced multiple times (once in each matching leaf node). This indeed achieves smaller amounts of candidates and even faster retrievement in every browser I tested (Win10 IE11, Edge, Chrome, FF). I put together two demos retrieving candidates from 10.000 objects with the old algorithm 1.1.3 and the new algorithm 1.2.0 and I'm thrilled by the improvements. This repository, npm registry and the online examples are updated to 1.2.0. I'd be happy about some feedback if this change fixes the issue or if I'm missing something. Then I will close this issue. |
@timohausmann Thanks 👍 Now works better Can be detected only objects that intersect with the white box? |
Collision detection is currently out of scope for this project. You can code your own rectangle collision check after retrieving the green candidates: |
I am observing objects that are selected for collision which are not in the node even not in the boundry
The text was updated successfully, but these errors were encountered: