About the camera:
Currently I am about to finish two types of camera’s
-
A camera that keeps the same height from the terrain. It will adjust height when terrain height changes. A sample video is posted a couple of days ago.
-
Camera whcih will not try to keep same height. However height adjustment will be done if camera collides with something.
I will be able to push both by Staturday. You could try both and decide whcih one to keep. Or we could keep both and let the player decide
About increased deiagonal speed. This is normal. The readon is when you press W and D, the effctive movement (assuming movement rate is 1 unit) is 1 unit in X direction and 1 unit in Y direction. So the actual distance moved is sqrt(1^2 + 1^2) = sqrt(2) = 1.414, which is greater than 1. One way to avoid this would be to combine both vectors togther and normalize it which will give us a unit vector.
So:
User pressed W, effective movement vector is (0, 1, 0) whcih is already normalized.
User pressed D, effective movement vector is (1, 0, 0) whcih is again is normalized.
user pressed W+D, effective movement vector is (1, 1, 0), whcih when normzalied gives us (0.7072, 0.7072, 0) which is a unit vector ine the same movement direction, whose length is exactly 1 !!
The problem is addional sqrt operation on every key press. I try to avoid as many sqrt operations I can.
I will integrate into my camera integration.
PS: Sorry about the delay, I really hoped to psuh it by Thursday, but some work related emergency came up
EDIT: @ Oh I did not notice that you had posted the solution as well. Looks like we both think alike