Let's add support for maps whose coordinates span an arbitrary rectangle. So you could have a map on, for example, (-20,-20)-(20,20) or (10000, 5000)-(10030, 5030). Basically we just need to use a Rectangle in FieldOfViewMap instead of a Size.
A possible interface would be:
const map = new FieldOfViewMap(-100, -50, 100, 100); // (x, y, w, h)
// map now ranges from (-100, -50) to (-1, 49)
map.addBody(-10, -30);
This shouldn't hurt performance, but it would help users avoid needing to map their own coordinates into a (0,0)-origin map space. See discussion in #1
Let's add support for maps whose coordinates span an arbitrary rectangle. So you could have a map on, for example, (-20,-20)-(20,20) or (10000, 5000)-(10030, 5030). Basically we just need to use a
RectangleinFieldOfViewMapinstead of aSize.A possible interface would be:
This shouldn't hurt performance, but it would help users avoid needing to map their own coordinates into a (0,0)-origin map space. See discussion in #1