let A and B be polygons
let a and b be vectors representing the movement of said polygons within a game tick
let c be the movement of A relative to B a-b
calculate the transformation matrix Ta that transforms c into the vector (1, 0)
let A' and B' be T applied to A and B
for every point p in A' for every edge e = (e1, e2) in B' calculate the intersection of the segments (p, p+c) and e { subtract p from e and calculate whether e crosses the X-axis}
for every point p in B' for every edge e = (e1, e2) in A' calculate the intersection of the segments (p, p+c) and e { subtract p from e and calculate whether e crosses the X-axis}
return the shortest X coordinate among all intersections as the collision or no collision if there were no intersections
Ideally, both A' and B' should fit entirely in the cache when represented as arrays of coordinates as integers.
Benefit: adapts to number of object and to clustering
Problem: Subdividing requires recalculation by the object
Possible solution: object registers movement box
Problem: Shrinking now needs to take into consideration movement box sizes