Actually, in a week or so I was going to be looking into that for my stuff. I have a basic idea of it, but I still need to research the process of it. To my understanding this is one way it could work:
You have some form of spatial partitioning and frustum culling for your camera, then when you touch the screen you cast a ray through the view frustum and then run a test on all the objects in the frustum to see which ones intersect with the line. An optimization of this could be testing just the bounding areas of the objects and then doing more detailed tests on the objects in order from closest to farthest from the camera's position until you have an intersection with the object itself. This might be easier to understand than that:
Code:
ObjectList Objects;
RayCast Ray = Camera.CastRay(TouchPosition);
For each Object O in view frustum
{
BoundingArea BV = O.GetBoundingArea();
if(BV.IntersectsWithRay(Ray))
{
Objects.AddObjectToList(O);
}
}
For each Object O in Objects (IMPORTANT: Ordered from nearest to farthest)
{
if(O.IntersectsWithRay(Ray)) return O;
}
You'll have to figure out on your own how to order them from nearest to farthest from the camera, but I believe that is a pretty good method. There may be faster methods, but for now that's all I have.
I hope I helped!