The Gilbert–Johnson–Keerthi collision detection algorithm is
significantly faster than collision detection using the separating axis
theorem. GJK can only determine whether two shapes collide, but not the
penetration vector. The expanding polytype algorithm can use information
from GJK to quickly find the required vector.
Polygon triangulation bug:
In some cases Kongs triangulation algorithm produces triangles
with collinear points. The Polygon constructor removes one of
these and throws an error because there are not enough vertices.
Checking if the current points in a triangulation step are
collinear and discarding those triangles fixes the problem.
Class-commons lets you use any supporting class system as
backend for HC.
Add SpatialHash:draw() for debug purposes.