highfidelity/hifi — pull request #2783 by AndrewMeadows (2014-05-05 21:13:40+00:00)
Title: improved avatar walking on voxels

(1) This introduces a new avatar motion control model. Rather than use MyAvatar::addThrust() for keyboard events we instead set a "motor" velocity. The avatar motion code then tries to update the avatar's velocity until it agrees with the motor's velocity. The advantages of this system is that it will be easier to tune and achieve the intended avatar velocity for the more complex cases such as walking over obstacles. Control over the motor parameters will eventually be exposed to JS.

MyAvatar::addThrust() still works and can be used by scripts to push the avatar around. Unfortunately the thrust system must be updated frequently because the thrust gets cleared after it is applied whereas a motor system can be set once and it will be able to push steadily until it is changed. The motor controls are not yet exposed to JS -- only the keyboard control system uses it ATM.

(2) We now detect when the avatar is standing on voxels and modify the maximum keyboard control speeds for this case. When walking the avatar's speeds are more manageable.

(3) There were some bad normals that were causing avatar motion to snag at seams between voxes -- those have been fixed for when walking.

(4) Walking up and down stairs is NOT included in this PR: yet to be done.