This topic is 4516 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Let's say I have a one layer quadtree Root[child-1, child-2, child-3, child-4] So a square divided into four equals chunks. Now let's say I want to add an item to my quad tree - let's say it's big and exists partially in child-1 and child-2. Is it best to store the object in both children (this is what I'm thinking of doing). And what if the object happens to to hit all 4 children - store in all the children? Would I ever store objects in the root node? (I can imagine it would be worth it, if the object was at least as big as the root node) I'll probably be moving my items around reasonably often. Pretty basic :D Just a little unsure.

##### Share on other sites
If you can't subdivise the object into smaller parts, I guess the quadtree should store the object into its root node.

That is, you start with a single square. Then you subdivise it in 4 only if some objects can be completly contained into one children. If it overlapses more than one children node, the subdivision stops there.

Never made a QuadTree algorithm, but this is what I understand from literature.

Have fun

1. 1
Rutin
33
2. 2
3. 3
4. 4
5. 5

• 13
• 9
• 9
• 9
• 9
• ### Forum Statistics

• Total Topics
633330
• Total Posts
3011388
• ### Who's Online (See full list)

There are no registered users currently online

×