Line of Sight

Due Thursday, December 3

Create a new function for the game engine, called can_see. can_see should take two parameters, each a vec3, and return true if the two positions can see each other, false if they can't.
The two positions can see each other if there isn't anything in the way. Things that are solid can be in the way. It's up to you if non-solid things can too, but just considering solid is easier because solid things will have an in_contact method implemented, and so it is easy to check and see if a point is in contact with them.
Create a loop which will check every 0.25 units along a line from one position to the other for a solid object in contact with that position, and return false if one is found. Note that it is important the contacting object is not in the exact same spot as one of the endpoints (i.e. the object itself is blocking its own view). If that's the case, ignore the contact. Note that the function takes two arguments of type vec3, not GameObject*. You may want a helper function at some point that takes a GameObject* for project 5.
Once your function complete, add an object to the game which will react to the ability to see the player. The reaction is entirely up to you, but the object should provide a convincing demonstration that your function works.

Turn in the project by uploading whatever you need on isoptera. If you have a bunch of files, please put them together in some sort of archive.