- Remove the degenerate case of vertical directions, by updating the viewup as the camera moves.
- Remove the consequent limitation to 89.9 degrees.
- Add (unused so far) camera roll angle, with setter.
- Add accessors for all angles. Lua will want to know that.
- Rename m_angleV/H to m_viewAngleV/H to distinguish them clearly from the orientation of the mesh. They will differ e.g. when the player is sitting somewhere.
- Rename vertical turn so it includes 'view' in the name, because this one does not affect the player's rotation as turnH does.
- Make player look north at start, like it originally did before the Z-up changes.
Improve rendering precision by subtracting the camera position from the models' position, then temporarily setting the camera to (0, 0, 0) for rendering. This keeps GL coordinates in a low range.
While this fixes the calculation, it introduces visibility determination problems, because the method was not correct. The centre may be out of the area of the camera, with nodes still visible inside. To fix this, the eight corners of the chunk need to be considered.
Missed the case of getting rid of the box at the southwest.
We take the chance for making it more robust by checking all four corners, just in case there's a platform with trouble in an edge case.
Fix chunk visibility test and visibility of world at start.
The assumptions about the working of screen coordinates in the previous commit were clearly wrong.
Fix UVs and ambient occlusion maps. The change of chirality was not enough, as that rotated faces, so that needed to be fixed. This affected vertex indices that were manipulated by the AO algorithm, which needed to be fixed as well.
Bulk of the changes: swap Y and Z, HEIGHT and DEPTH mostly everywhere; change vertex order to make it right-handed; rename Left, Right, Front, Back to West, East, South, North respectively; switch some arrays and loops to Z,Y,X order.
That allows them to escape from being unable to move due to being trapped with the camera inside a node (assuming the node is diggable).
Note: The implementation is a bit of a hack. It doesn't consider the lookAt direction.