Just wondering - have you done any performance analysis regarding this?
Both resolve to PhysX sdk scene queries against an internal culling structure.
In general, the queries are resolved in 3 steps (taken from Scene Queries — NVIDIA PhysX SDK 3.4.0 Documentation):
- Broad phase traverses the global scene spatial partitioning structure to find the candidates for mid and narrow phases.
- midphase traverses the triangle mesh and heightfield internal culling structures, to find a smaller subset of the triangles in a mesh reported by the broad phase.
- Narrow phase performs exact intersection tests (ray test for raycast() queries, and exact sweep shape tests or overlap tests for sweep() and overlap() queries).
I was under the impression UE can support a relatively large number of queries every tick, and that both the overlap and the raycast are fairly equivalent in terms of performance, although I have not done any specific research yet.
Since a spatial partitioning structure is continually updated with all object positions, resolving scene queries may be very fast.
I am hoping to do a little more research and will post any findings.