The application discloses a
ray detection method and device, equipment and a storage medium, and relates to the technical field of computers. In the method, the
minimum distance is the minimum hit distance corresponding to all virtual elements that have not been detected by the remaining nodes in the node
queue. Accordingly, if the hit distance of the current virtual element is not greater than the hit distance of the second node, it indicates that the hit distance of the virtual element will not be greater than any virtual element subsequently detected from the node
queue, that is, the virtual element is the virtual element closest to the starting point of the
ray and is the virtual element most likely to meet the target event detection requirement. At this time, the virtual element is directly detected based on the detection requirement, and if the detection requirement is met, subsequent detection is terminated immediately, and there is no need to process other nodes with a farther hit distance in the node
queue. Therefore, the method can significantly reduce invalid node traversal and intersection calculation, significantly improve the
ray detection efficiency under the premise of ensuring the
correctness of the detection result.