Jump to content
  • Advertisement
Sign in to follow this  
lucky6969b

How To Search A Quadnode Fast?

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

If the maximum level of division is 6, and I start off at the root,

If I search if the point intersects with the current quadnode's bounding box,

the worst case is 24 iterations, am I correct?

If I sort the bounding boxes in advance, and use a binary search,

the maximum speed is 12 iterations, right?

 

In the octree case, the worst case is doubled, to 48 iterations,

with binary search of 24 iterations in the worst case?

 

Is it possible to use a position, just any positions, as a hash key....

I think it's only possible if the array is fixed size, I don't know how to do it if the octree is sparse

Thanks

Jack

Edited by lucky6969b

Share this post


Link to post
Share on other sites
Advertisement
If you get the integer position of the node in tree-space, subsequent bits (1 for each axis, 2 total for quadtree) will index into the correct child node (as if it was 2x2 array).

So on nth level, read nth bit of position on each axis (first bit is most significant bit - make sure the zero pos is in middle of integer range like with signed ints)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!