highfidelity/hifi — pull request #3361 by AndrewMeadows (2014-09-05 21:07:47+00:00)
Title: expose the _measured_ MyAvatar.getVelocity() to JS

This project is an attempt to make MyAvatar.getVelocity() work properly for JS scripts that want to use it. There were a couple of problems:

(1) MyAvatar.getVelocity() was always returning <0,0,0>. It now returns the _measured_ velocity of the avatar after all effects (after collisions, friction, etc).

(2) Once issue (1) was fixed the value returned could vary (with incorrect values) depending on when the script actually captured the the velocity in the main simulation loop. Granted, the window for incorrect values was probably pretty narrow but nevertheless non-zero. Progress has been made (but is not perfect) to isolate the measured velocity from intermediate calculations.