SpatialHashing is a spatial index used by EntityManager for collision detection. It is based on the paper "Optimization of Large-Scale, Real-Time Simulations by Spatial Hashing" (Erin J. Hastings, Jaruwan Mesit, Ratan K. Guha). I also had a look at the implementation described here.
The objects registered in the index should be circles and have getter methods for position and radius.
Create a new instance of SpatialHashing with the given dimensions and resolution. The dimensions are in metres. The cell size should be able to fully contain the largest entity in order to function correctly.
register the entity in the index
clear the index
A bit of a hack to see the cells that contain a line. This is used for adding and colliding with Wall objects