How can I find the closest vector to another in a specific direction?
- by Sniper
Perhaps I am not phrasing it incorrectly in my searches, but I can not find anything on this.
I have a vector3 with a specific direction that it is facing, I want to get the closest object to that position in that specific direction. Basically I want to get the object that is being aimed at.
I have thought about finding all objects within a box and then finding the closest object to my vector from them results, but I am sure that there is a more efficient way.
The Z axis is optional, the objects are most likely within a few meters of the search vector.
http://i.stack.imgur.com/FafAu.jpg