This project has moved and is read-only. For the latest updates, please go here.

Cone-shaped line of sight

Jun 12, 2013 at 5:01 PM
Hello! I was wondering if there was a way of getting your code to do calculate a cone of size N representing sight, given an origin X,Y and a direction as one of N,S, NW, NE, SW,SE.

Thank you!
Jun 13, 2013 at 12:05 PM
The field-of-view is calculated in 30 degree segments (dodecants)). If your requested cone comprised a subset of whole dodecants, then passing in a mask of live dodecants would perform exactly what you are looking for. The code would only need to be tweaked to accept and use such a mask as a parameter.

If you need more precision than that, a start and stop vector would need to be passed in. The code currently doesn't support that, but it is next on the project list after I finish tuning path-finding. I will need that functionality myself for my own game engine. What is your time line for needing this?