mrdoob/three.js — pull request #2337 by inolen (2012-08-17 19:53:40+00:00)
Title: Added pointerLock support to FirstPersonControls, removed duplicate calculations from old merge

While adding pointerLock support, I changed the default functionality of how the mouse's position is used to move the camera.

The code use to constantly evaluate the difference between the center of the screen and the current mouse position as the movement delta, which left the camera constantly moving if you weren't at the dead center of the screen. It now just uses the delta between each subsequent mousemove event - which may not be desired.

I did it as I felt it synchronized the experience between having pointerLock enabled and having it disabled, but if it's not desired we could easily leave it to work that way when pointerLock is enabled, and the old way when disabled.

Also, I removed some code where the update routine was re-calculating the lat, lon and targetPosition a second time. This appears to have creeped up during an old merge, but perhaps I was being really daft and there was some purpose to it. However, it seemed unnecessary.