utilities
utilities copied to clipboard
Add generic SquareTilemap class
- [x] size of tile map should be arbitrary (as available memory and integer coordinates allow)
- [ ] needs support to translate between real positions and tiles, like
- vector2 tile.Center (maybe any corner, plus single coordinate sides)
- tile = tilemap.TileAt(vector2)
- [ ] should allow for arbitrary position offset
- [ ] size of square should be arbitrary (any float/double)
- [x] allow for easy enumeration of tiles
- [ ] allow to enumerate tiles intersecting rectangle/ray
This type could be used as regular tile map, or to divide game world space as acceleration data structure. With the ray-enumeration it can further be used to assist ray casting.
To consider:
- use plain vectors or SpaceTime2 types as coordinates?
- use int vector as tile positions (#42)?
- include tile-offset as well? (allows for easily centering tile map around 0,0 tile for example)