Best wishes,
I might consider some methods of using spherical Bounding Volume Hierarchies. But other techniques you might want to check out are BSP (Binary Space Partitioning) Trees/KD Trees or use Octree
There are thousands of rays and triangles. We need to get all the intersection points. If we use normal For the two-level loop, we need O(mn) time complexity. Is there a way to reduce the time complexity from O(mn) to O(m * logn) or O(logm * n)?
Best wishes,
What you might want to see is some kind of space partitioning technology. This allows you to quickly Exclude the set of triangles.
I might consider some methods of using spherical Bounding Volume Hierarchies. But other techniques you might also want to check out are BSP (Binary Space Partitioning) Trees/KD Trees or use Octree