getObject(x,y,z) which, given a point (X,Y,Z) will return the object in which that point is contained. There will be no overlapping objects, so each point can be mapped only to one object.
I could use a 3D array, which turns into a very fast getObject function, but then I'd have a huge amount of data, which would be a problem as it's a web application. On the other hand I could do it storing just the x,y and z boundaries for each object, but then the function getObject would be slower is it would have to iterate over all objects.
I am sure this design problem has been faced before by many people.
preguntado el 08 de noviembre de 11 a las 17:11