If you look in the upper right corner, you will see a line of enemy units on the radar.
I was wondering what is the most efficient or easiest way (small code, fairly accurate, should not be ideal) to find that something is in your field of vision? I may or should not display it (I most likely will not).
I don't know the formula and haven't used any math libraries / namespaces in C #
-edit -
This is mainly a 2d prototype. nothing should be perfect, and he will have a moving camera, units, and it will look only upwards, but not diagonally. There may be a direct line of sight to the wall, but nothing else. Also, other enemies should not trigger an action when they enter it.
So I really need a source (enemy), dst (player) and see that the walls block my vision.
alt text http://image.com.com/gamespot/images/screenshots/gs/action/metalgearsolid/metalgearsolid_790screen001.jpg
-edit- I ended up using rect. This was good enough, and I was able to work on another prototype, then writing raycast code.
user34537
source
share