Jump to content

View more

Image of the Day

The night is still, but the invasion brings chaos. #screenshotsaturday #hanako #indiegame #gameart #ue4 #samurai https://t.co/cgILXuokoS
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Binary tree leaf edge neighbors

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
1 reply to this topic

#1 NumberXaero   Prime Members   

2608
Like
0Likes
Like

Posted 18 January 2014 - 12:08 PM

I have a 2d area split up using a binary tree (axial aligned, split longest edge), is there any (known) way of determining the neighbor leafs of a given leaf (rect) edge while building the tree or right after the tree is built?

In time the tree may get big, I cant really pre compute much and would like to avoid direct searches for the 4 edges of each leaf (a leaf edge may be connected to many leafs smaller than itself), which is why Id like to create this static list of leaf connections and neighbor leafs as quick as possible.


Edited by NumberXaero, 18 January 2014 - 01:03 PM.


#2 JohnnyCode   Members   

1165
Like
0Likes
Like

Posted 23 January 2014 - 11:28 AM

If the questoin is you want to know hierarchy neighbors of a node (or leaf), you could just see its parent's childs. You say you have a binary tree, what means a node has only two childs or less. In case you do not store the information af a node's childs, but only a node parent, you will have to profile all nodes, but this is just etremely rare case of a tree aplication.






Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.