In the true spirit of emergent design, last night's session was spent refactoring a chunk of functionality - player action and camera controls were brought over to the new action containers, and player physics was split out into its own handling functions. Collision detection was rewritten (again) because the game's non-linear 3D space makes efficient collision detection a little non-trivial.
And then I spent a good couple of hours banging my head on the keyboard trying to figure out why suddenly my player stopped moving. In the end:
- Buggy rotation code. Rather than copy and paste, or (God forbid) actually moving the old rotation code into an abstracted rotation function, I'd retyped the rotations for the player camera orientations. Big problem, of course: I'd forgot a Conjugate() call on my quaternion code and *foom* everything stopped working correctly. Note to self: You wrote a simpler Rotation function already - use it and optimise later!
- Very small numbers. Measuring the angle between two vectors is all cool and stuff, but translating back from the collision detection's linear result to the non-linear worldspace was causing near-zero rounding errors. Time to swap all that junk out for a proper slerp or - more likely - just use a linear interpolation at that point anyway. After all, we're talking about movement between frames here, it's not like the user's going to notice anything.
Ah well, some thinking on it today then more coding tonight - if I fix this maybe I can go resolve that horrible client connection bug.