What is an efficient way to find a non-colliding rectangle nearest to a location
Posted
by hyn
on Stack Overflow
See other posts from Stack Overflow
or by hyn
Published on 2010-06-18T07:35:28Z
Indexed on
2010/06/18
10:13 UTC
Read the original article
Hit count: 240
For a 2D game I am working on, I am using y axis sorting in a simple rectangle-based collision detection. This is working fine, and now I want to find the nearest empty rectangle at a given location with a given size, efficiently. How can I do this? Is there an algorithm?
I could think of a simple brute force grid test (with each grid the size of the empty space we're looking for) but obviously this is slow and not even a complete test.
© Stack Overflow or respective owner