highfidelity/hifi — pull request #3377 by AndrewMeadows (2014-09-08 20:18:35+00:00)
Title: fix for flickering avatars

The Avatar class was updating its rendered position using Avatar::_velocity, however it wasn't correctly updating _velocity -- it would be set to some large value when the the Avatar first showed up and would then would feedback on itself as the avatar was integrated to distant locations and then slammed back to its correct position upon receiving a new update from the AvatarMixer.

I've disabled extrapolation of an Avatar's position in Avatar::simulate(). This will cause Avatar's to move by teleportation (they only ever move when a new update packet arrives) but will prevent the extrapolation feedback. What we _should_ do is include the Avatar's velocity in the update packet... if we want to support fast moving avatars that get relatively few updates. Note that there is no good way to properly measure Avatar velocity if we're getting occasional updates AND we are extrapolating their position. That is, either we must constantly send updates at a rapid rate (and do no extrapolation) or we must also send Avatar velocity and then we can do extrapolation... any other path will cause flickers or severe rubber banding (when the update rate slows down).