What's the best way to find objects within a given area?

I want to be able to program functions like "FindObjectsInSphere", "FindObjectsInCameraView", or "FindObjectsInArcCone" (the last one is a subsection of a sphere bounded by an angle from the forward axis), but is there a better way of finding objects in a given area than starting by making a temporary trigger and seeing which objects overlap it before deleting it?

I have programmed some similar functions for finding players already, what I'm looking for is the best way to find objects within a given basic area so I can use that to construct more complex options for finding objects.

Edit: In some cases I may know what kind of object I'm looking for, but for others (such as checking whether something's obscured) I may not actually know what object I want to find. It should also be noted that I do wish to operate on Projectiles as well, as although they have their own position functions, they inherit from CoreObject.

Also, this code is going into a Rangefinder API which I intend to post to community content, which will include a number of useful functions for finding objects and where they are in relation to other objects.

One way is to create a table from the desired objects. And then run through them in a loop using the appropriate formula. For a sphere, this is the formula: objects at a distance from a point not exceeding the radius of the sphere.

This is a good solution if you know what kind of object you're looking for, but I can see there being cases where I don't, and this also requires some setup in advance as well. Nothing that can't be worked with, but minimal setup is definitely a plus in my case.

While both options presented here have merit, the recent introduction of the new World.SpherecastAll function is more or less exactly what I want here.

I may also end up including tables for desired objects, but that will be implemented later.