Smarter way to check proximity over many objects?

On 01/07/2014 at 16:24, xxxxxxxx wrote:

Hello all,

Does anyone know or have heard about a clever, faster way to check for proximity between individual objects in large groups without a nested for loop?  I've always done:

for object in parent.GetChildren() :
for everyOtherObject in parent.GetChildren() :
##Find distance here (ouch!)
if distance < thresholdValue:
##Whatever

But it seems so dumb.  Do you guys have any suggested reading or know-how on the matter?  Seems like someone would have asked this before, but I either overlooked a post or I'm not using the right search keywords.

Thanks a million in advance.

On 02/07/2014 at 05:12, xxxxxxxx wrote:

Hi Whithers,

You are looking for an Octree. :-)

https://en.wikipedia.org/wiki/Octree

Best,
-Niklas

On 02/07/2014 at 06:33, xxxxxxxx wrote:

:gasp: :smile:

Thank you so much.