Physics: Collision resolution fails and is not robust
We currently define body collision in terms of self.collision_box translated by self.position. The problem with this definition is that rounding error means that it is difficult for collision detection to achieve the specific absolute positions of the box's faces that definitely don’t collide with any block, because after picking a value for self.position, the resulting translated collision box then has
rounding error. nudge_on_ray() tries to fix this during collision resolution, but doesn’t succeed sometimes.
I think we can solve this problem by defining a collision box in absolute coordinates, which can be computed sometimes-exactly to ensure they land on the correct side of surfaces collided with. As a brute-force strategy, we can always slightly squish the box to compensate for rounding errors that lead to intersection. Then, by also keeping the original relative-coordinate collision box, we can restore the intended shape when no collision occurs.
Commit 8b74029067166e31a1462eaafd4de7c9c1cba01e implements the first part of this, by adding the absolute collision box (named occupying). However, I still need to actually make it used in this way; right now it is only written, not read.
Blocking #272.