Game Development Community

ContainerFindFirst - distance based?

by Steve Acaster · in Technical Issues · 05/13/2008 (10:01 am) · 3 replies

I was just wondering whether ContainerFindFirst bases the returning object on distance closest to the container's origin or on the objects' numerical ID value in the whole radius (e.g. ID1788 being a lower value than ID2746)?

#1
05/13/2008 (6:19 pm)
And the answer seems to be distance - but working from the outer edge of the radius back to the origin, and it seems to use the world axis XYZ rather than be based on the object orientation, so it doesn't seem to search centrally (spiralling) in to the origin but along the axis individually --- which isn't very useful for what I was hoping for.

But question solved, anyhow.
#2
05/13/2008 (7:45 pm)
The world has a grid of "bins" overlaid on it, which is used to dramatically speed up proximity searches,
so this is probably returning the first object in the "first" bin which is in the container,
where "first" bin is in bin-order, which, yeah, is probably world-aligned.
#3
05/14/2008 (6:44 am)
Ah, I see. I was hoping it would search out from the origin to detect closest first - and now I realise why it didn't have an exlude variable in the code like ContainerRayCast does. Best for me to search with InitContainerRadiusSearch, sort by VectorDist and add an exclude/ignore from the origin object, then.

Cheers for the info.