hump
hump copied to clipboard
polygon function to draw visible area
A visibility function to get the polygon of visible area from a list of segments (walls).
There are three new functions in vector.lua used by visibility function: intersection
, alignment
and polar_lt
I put a demonstration script, unit test script and performance timer script.
I very much appreciate the additon of unit tests. However, what isn't clear to me from this is what visibles.polygon is actually for. The demo does not make it much clearer I'm afraid. Cna you explain it further?
Ah I feel silly, it is for calculating line of sight. This seems like something handy, but I'm not sure it belongs in hump rather than in a standalone library. Either way I'll give it another review so you can use the feedback whether we merge or you make your own library.
Thanks for these reviews. I will see to them but not for several months.