...Some of the code is left in an unfinished/testing state. This game was a learning experiment for me, and the math used is tested until it works for the game. After using the science math by the book, there were still flaws that could make the player get stuck under certain conditions (since floating point is not exact), and the workarounds for this are just my own ideas.
Have looked at the code for other 3D games and there are mostly the same problems around collision detection and "hacks" to get it to "work".