Answer the question
In order to leave comments, you need to log in
What are the algorithms for determining the object under the mouse cursor?
You need to determine which object is under the mouse cursor.
So far, the only option that came to mind is to collect all the objects and check each for coordinates, but there are a lot of objects, so I divided the entire area into sectors and, selecting a sector with the mouse, check its collection of objects. How can this algorithm be simplified? Better yet, are there other ways? (Preferably with a more or less balance between simplicity and performance, because the area can be large, and objects exceed a million)
Thank you.
Answer the question
In order to leave comments, you need to log in
For example, in Unity 3D, you can cast a ray from the cursor coordinates into the depth and check whether it intersects with any object.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question