How can I find the closest vector to another in a specific direction?

Posted by Sniper on Game Development See other posts from Game Development or by Sniper
Published on 2012-07-07T20:23:02Z Indexed on 2012/07/07 21:24 UTC
Read the original article Hit count: 104

Filed under:
|
|
|

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

© Game Development or respective owner

Related posts about c#

Related posts about 3d