Kruptein / PlanarAlly

A companion tool for when you travel into the planes.
https://www.planarally.io/
MIT License
392 stars 71 forks source link

feat(Circle): Approximate circle with polygon for vision #1309

Closed Kruptein closed 10 months ago

Kruptein commented 10 months ago

The vision system uses points to do its magic. Given that a circle by definition has infinite points, this was originally "solved" by just approximating it with a bounding box, resulting in all circle-based light-blockers to appear as squares.

This is obviously not ideal and has lead me to use polygons for all things circle based.

This PR sets out to fix this discrimination against circles by approximating them with a polygon based on the radius of the circle. it will not be a 100% perfect overlap, but it should be close enough for your traditional needs.