Implements spatial hashing, to performantly run distance checks, find all entities located in the same cell, or neighboring cells.